CMake: simplify the KPMcore helper
This commit is contained in:
parent
09ed07b0c8
commit
f42f2514cb
@ -10,9 +10,7 @@
|
|||||||
# If KPMcore is not found, still create calamares::kpmcore interface
|
# If KPMcore is not found, still create calamares::kpmcore interface
|
||||||
# library, which will add definition WITHOUT_KPMcore.
|
# library, which will add definition WITHOUT_KPMcore.
|
||||||
#
|
#
|
||||||
if(NOT KPMcore_searched_for AND NOT TARGET calapmcore)
|
if(NOT TARGET calapmcore)
|
||||||
set(KPMcore_searched_for TRUE)
|
|
||||||
|
|
||||||
find_package(KPMcore 20.04.0)
|
find_package(KPMcore 20.04.0)
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
KPMcore
|
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_link_libraries(calapmcore INTERFACE kpmcore Qt5::DBus KF5::I18n KF5::WidgetsAddons)
|
||||||
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
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()
|
else()
|
||||||
set(KPMcore_API_DEFINITIONS WITHOUT_KPMcore)
|
target_compile_definitions(calapmcore INTERFACE WITHOUT_KPMcore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(d ${KPMcore_API_DEFINITIONS})
|
|
||||||
target_compile_definitions(calapmcore INTERFACE ${d})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_library(calamares::kpmcore ALIAS calapmcore)
|
add_library(calamares::kpmcore ALIAS calapmcore)
|
||||||
else()
|
else()
|
||||||
if(TARGET kpmcore)
|
if(TARGET kpmcore)
|
||||||
|
Loading…
Reference in New Issue
Block a user