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 "22")
0012 set (RELEASE_SERVICE_VERSION_MINOR "11")
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 "5.15.2")
0029 set(KF5_MIN_VERSION "5.90")
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 ${KF5_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 
0049 ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KPMCORE
0050                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpmcore_version.h"
0051                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfigVersion.cmake"
0052                         SOVERSION ${SOVERSION})
0053 
0054 if (NOT QT_MAJOR_VERSION)
0055     set(QT_MAJOR_VERSION "5")
0056 endif()
0057 
0058 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} COMPONENTS REQUIRED
0059   Core
0060   DBus
0061   Gui
0062   Widgets
0063 )
0064 
0065 # Load the frameworks we need
0066 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
0067   CoreAddons
0068   I18n
0069   WidgetsAddons
0070 )
0071 
0072 find_package(PolkitQt${QT_MAJOR_VERSION}-1 REQUIRED)
0073 
0074 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
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)