Warning, /system/kpmcore/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2008 Volker Lanz <vl@fidra.de> 0002 # SPDX-FileCopyrightText: 2015 Teo Mrnjavac <teo@kde.org> 0003 # SPDX-FileCopyrightText: 2014-2022 Andrius Štikonas <andrius@stikonas.eu> 0004 # SPDX-FileCopyrightText: 2020 David Edmundson <kde@davidedmundson.co.uk> 0005 0006 # SPDX-License-Identifier: GPL-3.0-or-later 0007 0008 cmake_minimum_required(VERSION 3.16 FATAL_ERROR) 0009 0010 # KDE Application Version, managed by release script 0011 set (RELEASE_SERVICE_VERSION_MAJOR "24") 0012 set (RELEASE_SERVICE_VERSION_MINOR "04") 0013 set (RELEASE_SERVICE_VERSION_MICRO "70") 0014 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") 0015 project(kpmcore VERSION ${RELEASE_SERVICE_VERSION}) 0016 0017 set(SOVERSION "12") 0018 add_definitions(-D'VERSION="${RELEASE_SERVICE_VERSION}"') #" 0019 0020 set(CMAKE_USE_RELATIVE_PATHS OFF) 0021 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) 0022 0023 # Note that KPMcore is restricted to only run binaries installed into trusted prefixes 0024 # See src/util/trustedprefixes 0025 # By default this is set to / and /usr which is good for majority of distros 0026 0027 # Dependencies 0028 set(QT_MIN_VERSION "6.5.0") 0029 set(KF_MIN_VERSION "5.240.0") 0030 set(BLKID_MIN_VERSION "2.33.2") 0031 # PolkitQt5-1 0032 0033 # Runtime 0034 # smartmontools 7.0 0035 0036 set(KDE_COMPILERSETTINGS_LEVEL "5.85") 0037 0038 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) 0039 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/") 0040 0041 include(KDEInstallDirs) 0042 include(KDECMakeSettings) 0043 include(KDECompilerSettings NO_POLICY_SCOPE) 0044 include(FeatureSummary) 0045 include(GenerateExportHeader) 0046 include(ECMSetupVersion) 0047 include(ECMConfiguredInstall) 0048 include(ECMDeprecationSettings) 0049 0050 ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KPMCORE 0051 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpmcore_version.h" 0052 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake" 0053 SOVERSION ${SOVERSION}) 0054 0055 find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS REQUIRED 0056 Core 0057 DBus 0058 Gui 0059 Widgets 0060 ) 0061 0062 # Load the frameworks we need 0063 find_package(KF6 ${KF_MIN_VERSION} REQUIRED 0064 CoreAddons 0065 I18n 0066 WidgetsAddons 0067 ) 0068 0069 find_package(PolkitQt6-1 REQUIRED) 0070 0071 ecm_set_disabled_deprecation_versions(QT 5.15.2 0072 KF 5.240 0073 ) 0074 0075 kde_enable_exceptions() 0076 0077 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 0078 find_package(PkgConfig REQUIRED) 0079 pkg_check_modules(BLKID REQUIRED blkid>=${BLKID_MIN_VERSION}) 0080 endif() 0081 0082 add_subdirectory(src) 0083 0084 # create a Config.cmake and a ConfigVersion.cmake file and install them 0085 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KPMcore") 0086 0087 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KPMcoreConfig.cmake.in" 0088 "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake" 0089 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0090 ) 0091 0092 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake" 0093 "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake" 0094 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0095 COMPONENT Devel ) 0096 0097 install(EXPORT KPMcoreTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KPMcoreTargets.cmake ) 0098 0099 ki18n_install(po) 0100 0101 set_target_properties( kpmcore 0102 PROPERTIES VERSION ${RELEASE_SERVICE_VERSION} SOVERSION ${SOVERSION} 0103 ) 0104 0105 message(STATUS "kpmcore ${RELEASE_SERVICE_VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}") 0106 0107 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0108 0109 enable_testing() 0110 add_subdirectory(test)