New cmake switch to skip installing configuration.

The INSTALL_CONFIG is "on" by default. When set to off,
no *.conf file, both global and related to a single module,
will be installed. A warning message is printed by cmake too,
and the module description is edited to make this visible.

This is useful for testing, when we want to install our
own libraries and binary but keep the configuration of the
live system we are testing on (e.g. path to distro image).

Tested on the master branch.
This commit is contained in:
shainer 2016-11-21 00:32:04 +00:00
parent 34516e9477
commit 8d5fbaafeb
3 changed files with 31 additions and 14 deletions

View file

@ -21,7 +21,7 @@ function( calamares_add_module_subdirectory )
configure_file( ${SUBDIRECTORY}/${MODULE_FILE} ${SUBDIRECTORY}/${MODULE_FILE} COPYONLY )
get_filename_component( FLEXT ${MODULE_FILE} EXT )
if( "${FLEXT}" STREQUAL ".conf" )
if( "${FLEXT}" STREQUAL ".conf" AND INSTALL_CONFIG)
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${MODULE_FILE}
DESTINATION ${MODULE_DATA_DESTINATION} )
list( APPEND MODULE_CONFIG_FILES ${MODULE_FILE} )
@ -38,7 +38,11 @@ function( calamares_add_module_subdirectory )
# message( " ${Green}FILES:${ColorReset} ${MODULE_FILES}" )
message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" )
if( MODULE_CONFIG_FILES )
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => ${MODULE_DATA_DESTINATION}" )
if (INSTALL_CONFIG)
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => ${MODULE_DATA_DESTINATION}" )
else()
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Skipping installation]" )
endif()
endif()
message( "" )
endif()