From cdb99ad887b55fa92b69dfd5aca9916706503090 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 14 May 2020 11:15:23 +0200 Subject: [PATCH] CMake: shuffle WITH_* settings for calamares executable - reminder to make all the ABI-relevant WITH_* settings available as #defines - move the compilation of KDSAG to the calamares executable, not the library - when DBus activation is on, drop all of kdsingleapplicationguard --- CMakeLists.txt | 7 +++++-- src/calamares/CMakeLists.txt | 14 ++++++++++++++ src/libcalamares/CMakeLists.txt | 19 ++----------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18b9b116b..a9e69a3da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,10 +50,13 @@ set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during develop option( INSTALL_CONFIG "Install configuration files" OFF ) option( INSTALL_POLKIT "Install Polkit configuration" ON ) option( INSTALL_COMPLETION "Install shell completions" OFF ) -option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) -option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF ) +# Options for the calamares executable option( WITH_KF5Crash "Enable crash reporting with KCrash." ON ) option( WITH_KF5DBus "Use DBus service for unique-application." OFF ) +# When adding WITH_* that affects the ABI offered by libcalamares, +# also update libcalamares/CalamaresConfig.h.in +option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON ) +option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF ) # Possible debugging flags are: # - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index 5c5a68a97..b632567b8 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -10,6 +10,20 @@ set( calamaresSources progresstree/ProgressTreeView.cpp ) +if( NOT WITH_KF5DBus ) + set( kdsagSources "" ) + foreach( _s + kdsingleapplicationguard/kdsingleapplicationguard.cpp + kdsingleapplicationguard/kdsharedmemorylocker.cpp + kdsingleapplicationguard/kdtoolsglobal.cpp + kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp + ) + list( APPEND kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/${_s} ) + endforeach() + mark_thirdparty_code( ${kdsagSources} ) + list( APPEND calamaresSources ${kdsagSources} ) +endif() + include_directories( ${CMAKE_SOURCE_DIR}/src/libcalamares ${CMAKE_SOURCE_DIR}/src/libcalamaresui diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index 6db1cb192..fa4265d6e 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -2,6 +2,7 @@ # translations, configurations, logging, utilities, global storage, and (non-GUI) jobs. add_definitions( -DDLLEXPORT_PRO ) +include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h ) @@ -60,22 +61,6 @@ set( libSources utils/Variant.cpp utils/Yaml.cpp ) -set( _kdsagSources - kdsingleapplicationguard/kdsingleapplicationguard.cpp - kdsingleapplicationguard/kdsharedmemorylocker.cpp - kdsingleapplicationguard/kdtoolsglobal.cpp - kdsingleapplicationguard/kdlockedsharedmemorypointer.cpp -) -set( kdsagSources "" ) -foreach( _s ${_kdsagSources} ) - list( APPEND kdsagSources ${CMAKE_SOURCE_DIR}/3rdparty/${_s} ) -endforeach() -mark_thirdparty_code( ${kdsagSources} ) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} -) ### OPTIONAL Python support # @@ -151,7 +136,7 @@ endif() ### LIBRARY # # -add_library( calamares SHARED ${libSources} ${kdsagSources} ) +add_library( calamares SHARED ${libSources} ) set_target_properties( calamares PROPERTIES VERSION ${CALAMARES_VERSION_SHORT}