From 1cf3ac810abed23fdd915f8cf0dc1bd6c5d142c8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 20 May 2019 12:25:23 +0200 Subject: [PATCH] [calamares] avoid extra defines for KCrash - Don't need an extra indirection from WITH_KF5Crash to WITH_KCRASH, just use the cmakedefine directly. - Since the setting is only used in main.cpp, move the define down there and remove cmakedefine entirely. --- src/calamares/CMakeLists.txt | 16 ++++++++-------- src/calamares/main.cpp | 4 ++-- src/libcalamares/CalamaresConfig.h.in | 6 ------ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index 1857b2b79..659865792 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -39,21 +39,21 @@ set_target_properties(calamares_bin ) calamares_automoc( calamares_bin ) -if( WITH_KF5Crash ) - set( LINK_LIBRARIES - KF5::CoreAddons - KF5::Crash - ) -endif() - target_link_libraries( calamares_bin PRIVATE ${CALAMARES_LIBRARIES} calamaresui Qt5::Core Qt5::Widgets - ${LINK_LIBRARIES} ) +if( WITH_KF5Crash ) + target_link_libraries( calamares_bin + PRIVATE + KF5::CoreAddons + KF5::Crash + ) + target_compile_definitions( calamares_bin PRIVATE WITH_KF5Crash ) +endif() install( TARGETS calamares_bin BUNDLE DESTINATION . diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index 5ddda33c6..f218b8ab9 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -26,7 +26,7 @@ #include "utils/Logger.h" #include "CalamaresConfig.h" -#ifdef WITH_KCRASH +#ifdef WITH_KF5Crash #include #include #endif @@ -84,7 +84,7 @@ main( int argc, char* argv[] ) { CalamaresApplication a( argc, argv ); -#ifdef WITH_KCRASH +#ifdef WITH_KF5Crash KAboutData aboutData( "calamares", "Calamares", a.applicationVersion(), diff --git a/src/libcalamares/CalamaresConfig.h.in b/src/libcalamares/CalamaresConfig.h.in index cafbe9276..6fbab422c 100644 --- a/src/libcalamares/CalamaresConfig.h.in +++ b/src/libcalamares/CalamaresConfig.h.in @@ -10,12 +10,6 @@ //cmakedefines for CMake variables (e.g. for optdepends) go here #cmakedefine WITH_PYTHON - -#cmakedefine WITH_KF5Crash -#ifdef WITH_KF5Crash -#define WITH_KCRASH -#endif - #cmakedefine WITH_PYTHONQT #endif // CALAMARESCONFIG_H