Indeed CMake, a list is not a directory...

After testing a Python module, the build was broken because the test
created a __pycache__ dir, which CMake tried to install as a file because:

a) `if(IS_DIRECTORY foo)` requires a full path to work

b) For CMake, `IS_DIRECTORY(foo)` is not the same as `IS_DIRECTORY foo`

c) CMake is a pain sometimes
This commit is contained in:
Aurélien Gâteau 2014-07-24 10:14:42 +02:00
parent f2ab67b28b
commit b3ba56a829

View File

@ -15,7 +15,7 @@ function( calamares_add_module_subdirectory )
# synced with the bindir structure and installed. # synced with the bindir structure and installed.
file( GLOB MODULE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" ) file( GLOB MODULE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY} "${SUBDIRECTORY}/*" )
foreach( MODULE_FILE ${MODULE_FILES} ) foreach( MODULE_FILE ${MODULE_FILES} )
if( NOT IS_DIRECTORY( ${MODULE_FILE} ) ) if( NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}/${MODULE_FILE} )
configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY ) configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE} install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
DESTINATION ${MODULE_DESTINATION} ) DESTINATION ${MODULE_DESTINATION} )