CMake: always copy the config files to the build directory.
Switching to INSTALL_CONFIG=OFF breaks tests by not having them in the build directory. Some logic was coupling not-installing to not-using-in-build-dir too closely.
This commit is contained in:
parent
cfe92252d2
commit
2f6e80dc42
@ -85,9 +85,11 @@ function( calamares_add_module_subdirectory )
|
|||||||
configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY )
|
configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY )
|
||||||
|
|
||||||
get_filename_component( FLEXT ${MODULE_FILE} EXT )
|
get_filename_component( FLEXT ${MODULE_FILE} EXT )
|
||||||
if( "${FLEXT}" STREQUAL ".conf" AND INSTALL_CONFIG)
|
if( "${FLEXT}" STREQUAL ".conf" )
|
||||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
|
if( INSTALL_CONFIG )
|
||||||
DESTINATION ${MODULE_DATA_DESTINATION} )
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
|
||||||
|
DESTINATION ${MODULE_DATA_DESTINATION} )
|
||||||
|
endif()
|
||||||
list( APPEND MODULE_CONFIG_FILES ${MODULE_FILE} )
|
list( APPEND MODULE_CONFIG_FILES ${MODULE_FILE} )
|
||||||
else()
|
else()
|
||||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
|
||||||
@ -102,10 +104,11 @@ function( calamares_add_module_subdirectory )
|
|||||||
message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" )
|
message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" )
|
||||||
if( MODULE_CONFIG_FILES )
|
if( MODULE_CONFIG_FILES )
|
||||||
if ( INSTALL_CONFIG )
|
if ( INSTALL_CONFIG )
|
||||||
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => ${MODULE_DATA_DESTINATION}" )
|
set( _destination "${MODULE_DATA_DESTINATION}" )
|
||||||
else()
|
else()
|
||||||
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Skipping installation]" )
|
set( _destination "[Build directory only]" )
|
||||||
endif()
|
endif()
|
||||||
|
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => ${_destination}" )
|
||||||
endif()
|
endif()
|
||||||
message( "" )
|
message( "" )
|
||||||
endif()
|
endif()
|
||||||
|
@ -66,17 +66,18 @@ function( calamares_add_plugin )
|
|||||||
message( " ${Green}TYPE:${ColorReset} ${PLUGIN_TYPE}" )
|
message( " ${Green}TYPE:${ColorReset} ${PLUGIN_TYPE}" )
|
||||||
message( " ${Green}LINK_LIBRARIES:${ColorReset} ${PLUGIN_LINK_LIBRARIES}" )
|
message( " ${Green}LINK_LIBRARIES:${ColorReset} ${PLUGIN_LINK_LIBRARIES}" )
|
||||||
message( " ${Green}LINK_PRIVATE_LIBRARIES:${ColorReset} ${PLUGIN_LINK_PRIVATE_LIBRARIES}" )
|
message( " ${Green}LINK_PRIVATE_LIBRARIES:${ColorReset} ${PLUGIN_LINK_PRIVATE_LIBRARIES}" )
|
||||||
# message( " ${Green}SOURCES:${ColorReset} ${PLUGIN_SOURCES}" )
|
|
||||||
# message( " ${Green}UI:${ColorReset} ${PLUGIN_UI}" )
|
|
||||||
# message( " ${Green}EXPORT_MACRO:${ColorReset} ${PLUGIN_EXPORT_MACRO}" )
|
|
||||||
# message( " ${Green}NO_INSTALL:${ColorReset} ${PLUGIN_NO_INSTALL}" )
|
|
||||||
message( " ${Green}PLUGIN_DESTINATION:${ColorReset} ${PLUGIN_DESTINATION}" )
|
message( " ${Green}PLUGIN_DESTINATION:${ColorReset} ${PLUGIN_DESTINATION}" )
|
||||||
if( PLUGIN_CONFIG_FILES )
|
if( PLUGIN_CONFIG_FILES )
|
||||||
|
set( _destination "(unknown)" )
|
||||||
if ( INSTALL_CONFIG AND NOT PLUGIN_NO_INSTALL )
|
if ( INSTALL_CONFIG AND NOT PLUGIN_NO_INSTALL )
|
||||||
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${PLUGIN_CONFIG_FILES} => ${PLUGIN_DATA_DESTINATION}" )
|
set( _destination "${PLUGIN_DATA_DESTINATION}" )
|
||||||
|
elseif( NOT PLUGIN_NO_INSTALL )
|
||||||
|
# Not INSTALL_CONFIG
|
||||||
|
set( _destination "[Build directory only]" )
|
||||||
else()
|
else()
|
||||||
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${PLUGIN_CONFIG_FILES} => [Skipping installation]" )
|
set( _destination "[Skipping installation]" )
|
||||||
endif()
|
endif()
|
||||||
|
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${PLUGIN_CONFIG_FILES} => ${_destination}" )
|
||||||
endif()
|
endif()
|
||||||
if( PLUGIN_RESOURCES )
|
if( PLUGIN_RESOURCES )
|
||||||
message( " ${Green}RESOURCES:${ColorReset} ${PLUGIN_RESOURCES}" )
|
message( " ${Green}RESOURCES:${ColorReset} ${PLUGIN_RESOURCES}" )
|
||||||
@ -147,12 +148,13 @@ function( calamares_add_plugin )
|
|||||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_DESC_FILE}
|
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_DESC_FILE}
|
||||||
DESTINATION ${PLUGIN_DESTINATION} )
|
DESTINATION ${PLUGIN_DESTINATION} )
|
||||||
|
|
||||||
if ( INSTALL_CONFIG )
|
foreach( PLUGIN_CONFIG_FILE ${PLUGIN_CONFIG_FILES} )
|
||||||
foreach( PLUGIN_CONFIG_FILE ${PLUGIN_CONFIG_FILES} )
|
configure_file( ${PLUGIN_CONFIG_FILE} ${PLUGIN_CONFIG_FILE} COPYONLY )
|
||||||
configure_file( ${PLUGIN_CONFIG_FILE} ${PLUGIN_CONFIG_FILE} COPYONLY )
|
if ( INSTALL_CONFIG )
|
||||||
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_CONFIG_FILE}
|
install(
|
||||||
DESTINATION ${PLUGIN_DATA_DESTINATION} )
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_CONFIG_FILE}
|
||||||
endforeach()
|
DESTINATION ${PLUGIN_DATA_DESTINATION} )
|
||||||
endif()
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
Reference in New Issue
Block a user