CMake: provide calamares::kpmcore only when kpmcore was found
This works around older CMakes that refuse to set arbitrary properties on a target. Instead, use calamares::kpmcore as the specific indicator that kpmcore was found. Breaks build of libcalamares, since that needs **something** regardless of whether KPMcore was found.
This commit is contained in:
parent
0688c7f4e7
commit
8a43ed99ed
@ -34,16 +34,18 @@ if(NOT TARGET calapmcore)
|
|||||||
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
||||||
# If there were KPMcore API variations, figure them out here
|
# If there were KPMcore API variations, figure them out here
|
||||||
# target_compile_definitions(calapmcore INTERFACE WITH_KPMcore)
|
# target_compile_definitions(calapmcore INTERFACE WITH_KPMcore)
|
||||||
set_target_properties(calapmcore PROPERTIES KPMcore_FOUND TRUE)
|
|
||||||
|
# Flag that this library has KPMcore support. A variable
|
||||||
|
# set here has the wrong scope. ENV{} would be visible
|
||||||
|
# everywhere but seems the wrong thing to do. Setting
|
||||||
|
# properties on calapmcore requires a newer CMake than
|
||||||
|
# Debian 11 has, so runs into support issues.
|
||||||
|
add_library(calamares::kpmcore ALIAS calapmcore)
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(calapmcore INTERFACE WITHOUT_KPMcore)
|
target_compile_definitions(calapmcore INTERFACE WITHOUT_KPMcore)
|
||||||
set_target_properties(calapmcore PROPERTIES KPMcore_FOUND FALSE)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(calamares::kpmcore ALIAS calapmcore)
|
|
||||||
else()
|
else()
|
||||||
get_target_property(KPMcore_FOUND calapmcore KPMcore_FOUND)
|
if(TARGET calamares::kpmcore)
|
||||||
if(KPMcore_FOUND)
|
|
||||||
message(STATUS "KPMcore has already been found")
|
message(STATUS "KPMcore has already been found")
|
||||||
set(KPMcore_FOUND TRUE)
|
set(KPMcore_FOUND TRUE)
|
||||||
else()
|
else()
|
||||||
|
Loading…
Reference in New Issue
Block a user