CMake: move kpmcore support into the helper-CMake-module

- find the dependencies just once
- fix the interface for kpmcore so it can find its own
  includes (this is mostly relevant for Debian)
This commit is contained in:
Adriaan de Groot 2022-07-03 11:31:32 +02:00
parent 0e6d70c395
commit ab813b607f
2 changed files with 7 additions and 7 deletions

View File

@ -18,10 +18,17 @@ if ( NOT KPMcore_searched_for )
TYPE RECOMMENDED
PURPOSE "For disk partitioning support"
)
find_package(Qt5 REQUIRED DBus) # Needed for KPMCore
find_package(KF5 REQUIRED I18n WidgetsAddons) # Needed for KPMCore
if( KPMcore_FOUND )
set( KPMcore_API_DEFINITIONS "" )
else()
set( KPMcore_API_DEFINITIONS WITHOUT_KPMcore )
endif()
foreach(d ${KPMcore_API_DEFINITIONS})
target_compile_definitions(kpmcore INTERFACE ${d})
endforeach()
target_include_directories(kpmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
endif()

View File

@ -115,13 +115,6 @@ endif()
include(KPMcoreHelper)
if(KPMcore_FOUND)
find_package(Qt5 REQUIRED DBus) # Needed for KPMCore
find_package(KF5 REQUIRED I18n WidgetsAddons) # Needed for KPMCore
foreach(d ${KPMcore_API_DEFINITIONS})
add_definitions(-D${d})
endforeach()
include_directories(${KPMCORE_INCLUDE_DIR})
target_sources(
calamares
PRIVATE