calamares/CMakeModules/KPMcoreHelper.cmake
Adriaan de Groot ab813b607f 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)
2022-07-10 13:38:48 +02:00

35 lines
1.0 KiB
CMake

# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
#
###
#
# Finds KPMcore and consistently sets API flags based on the version.
#
if ( NOT KPMcore_searched_for )
set( KPMcore_searched_for TRUE )
find_package( KPMcore 21.12.0 )
set_package_properties(
KPMcore PROPERTIES
URL "https://invent.kde.org/kde/kpmcore"
DESCRIPTION "KDE Partitioning library"
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()