From f42f2514cb492c13b547851f937beb448d967e6a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 21 Jul 2022 13:19:19 +0200 Subject: [PATCH] CMake: simplify the KPMcore helper --- CMakeModules/KPMcoreHelper.cmake | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeModules/KPMcoreHelper.cmake b/CMakeModules/KPMcoreHelper.cmake index 654fa8b0d..d1bfec684 100644 --- a/CMakeModules/KPMcoreHelper.cmake +++ b/CMakeModules/KPMcoreHelper.cmake @@ -10,9 +10,7 @@ # If KPMcore is not found, still create calamares::kpmcore interface # library, which will add definition WITHOUT_KPMcore. # -if(NOT KPMcore_searched_for AND NOT TARGET calapmcore) - set(KPMcore_searched_for TRUE) - +if(NOT TARGET calapmcore) find_package(KPMcore 20.04.0) set_package_properties( KPMcore @@ -34,15 +32,12 @@ if(NOT KPMcore_searched_for AND NOT TARGET calapmcore) target_link_libraries(calapmcore INTERFACE kpmcore Qt5::DBus KF5::I18n KF5::WidgetsAddons) target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR}) - set(KPMcore_API_DEFINITIONS "") + # If there were KPMcore API variations, figure them out here + # target_compile_definitions(calapmcore INTERFACE WITH_KPMcore) else() - set(KPMcore_API_DEFINITIONS WITHOUT_KPMcore) + target_compile_definitions(calapmcore INTERFACE WITHOUT_KPMcore) endif() - foreach(d ${KPMcore_API_DEFINITIONS}) - target_compile_definitions(calapmcore INTERFACE ${d}) - endforeach() - add_library(calamares::kpmcore ALIAS calapmcore) else() if(TARGET kpmcore)