From 40b7274c85899fdaf71b17177ed97cf2cd54a19a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 18 Dec 2022 01:18:33 +0100 Subject: [PATCH] CMake: copy settings.conf into the build directory Having an up-to-date settings.conf in the build directory makes `calamares -d` in that directory much more predicatable. This should not have used CMake command `install()`. FIXES #2075 CLOSEs #2079 --- CMakeLists.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 289aab268..86e8175f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -585,10 +585,6 @@ install( ### Miscellaneous installs # # -if( settings.conf IS_NEWER_THAN ${CMAKE_BINARY_DIR}/settings.conf ) - install(FILES settings.conf DESTINATION ${CMAKE_BINARY_DIR}) -endif() - if(INSTALL_POLKIT) install(FILES com.github.calamares.calamares.policy DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}") endif() @@ -605,7 +601,9 @@ install(FILES calamares.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/application install(FILES man/calamares.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/) -# uninstall target +### Uninstall +# +# configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" @@ -615,6 +613,17 @@ configure_file( add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +### Developer convenience +# +# The module support files -- .desc files, .conf files -- are copied into the build +# directory so that it is possible to run `calamares -d` from there. Copy the +# top-level settings.conf as well, into the build directory. +if( settings.conf IS_NEWER_THAN ${CMAKE_BINARY_DIR}/settings.conf ) + configure_file(settings.conf ${CMAKE_BINARY_DIR}/settings.conf COPYONLY) +endif() + + + ### CMAKE SUMMARY REPORT # get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)