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
This commit is contained in:
Adriaan de Groot 2020-05-14 11:15:23 +02:00
parent 1e09b823b7
commit cdb99ad887
3 changed files with 21 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -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}