CMake: restore INSTALL_CONFIG

This commit is contained in:
Adriaan de Groot 2023-11-09 21:52:12 +01:00
parent 1e12ad344f
commit 2b0c41609d
4 changed files with 24 additions and 2 deletions

View File

@ -36,6 +36,11 @@ This release contains contributions from (alphabetically by first name):
enabled, even the ones with no translations at all.
- The logging format in the `session.log` file and on-screen is now
more similar, although the file contains a lot more per-line information.
- The INSTALL_CONFIG option has been restored. It is still a terrible
idea to fork the repository to modify the config files, and you
probably should have a calamares-config package with those files
instead, there are packaging workflows that can usefully patch-and-
install configuration files. The option defaults to OFF.
## Modules ##
- All QML modules now have a Qt6-compatible set of QML files as well. (thanks Anke)

View File

@ -79,6 +79,7 @@ set(CALAMARES_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
#
option(INSTALL_POLKIT "Install Polkit configuration" ON)
option(INSTALL_COMPLETION "Install shell completions" OFF)
option(INSTALL_CONFIG "Install configuration files" OFF)
# When adding WITH_* that affects the ABI offered by libcalamares,
# also update libcalamares/CalamaresConfig.h.in
option(WITH_PYBIND11 "Use bundled pybind11 instead o Boost::Python" ON)
@ -682,6 +683,10 @@ install(FILES calamares.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/application
install(FILES man/calamares.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/)
if(INSTALL_CONFIG)
install(FILES settings.conf DESTINATION share/calamares)
endif()
### Uninstall
#
#

View File

@ -167,7 +167,14 @@ function( _calamares_add_module_subdirectory_impl )
message( " ${Green}TYPE:${ColorReset} jobmodule" )
message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" )
if( MODULE_CONFIG_FILES )
message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory only]" )
if (INSTALL_CONFIG)
message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory and ${MODULE_DATA_DESTINATION}]")
foreach(_cf ${MODULE_CONFIG_FILES})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${_cf} DESTINATION ${MODULE_DESTINATION})
endforeach()
else()
message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory only]")
endif()
endif()
message( "" )
# We copy over the lang directory, if any

View File

@ -104,7 +104,9 @@ function( calamares_add_plugin )
message( FATAL_ERROR "${Red}NO_CONFIG${ColorReset} is set, with configuration ${Red}${PLUGIN_CONFIG_FILES}${ColorReset}" )
endif()
set( _destination "(unknown)" )
if( NOT PLUGIN_NO_INSTALL )
if(INSTALL_CONFIG AND NOT PLUGIN_NO_INSTALL)
set(_destination "${PLUGIN_DATA_DESTINATION}")
elseif( NOT PLUGIN_NO_INSTALL )
set( _destination "[Build directory only]" )
else()
set( _destination "[Skipping installation]" )
@ -213,6 +215,9 @@ function( calamares_add_plugin )
message( " ${BoldYellow}Not updating${ColorReset} ${PLUGIN_CONFIG_FILE}" )
set( _warned_config ON )
endif()
if(INSTALL_CONFIG)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_CONFIG_FILE} DESTINATION ${PLUGIN_DATA_DESTINATION})
endif()
endforeach()
if ( _warned_config )
message( "" )