Warning, /frameworks/kpackage/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 cmake_minimum_required(VERSION 3.16) 0002 0003 set(KF_VERSION "5.116.0") # handled by release scripts 0004 set(KF_DEP_VERSION "5.115.0") # handled by release scripts 0005 project(KPackage VERSION ${KF_VERSION}) 0006 0007 # ECM setup 0008 include(FeatureSummary) 0009 find_package(ECM 5.115.0 NO_MODULE) 0010 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 0011 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 0012 0013 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) 0014 0015 include(KDEInstallDirs) 0016 include(KDECMakeSettings) 0017 include(KDEGitCommitHooks) 0018 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0019 0020 include(ECMGenerateExportHeader) 0021 include(ECMGenerateHeaders) 0022 include(CMakePackageConfigHelpers) 0023 include(ECMSetupVersion) 0024 include(ECMMarkNonGuiExecutable) 0025 include(ECMAddQch) 0026 include(ECMQtDeclareLoggingCategory) 0027 include(ECMSetupQtPluginMacroNames) 0028 include(ECMDeprecationSettings) 0029 0030 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") 0031 0032 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) 0033 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") 0034 0035 ecm_setup_version(PROJECT 0036 VARIABLE_PREFIX PACKAGE 0037 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kpackage_version.h" 0038 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfigVersion.cmake" 0039 SOVERSION 5) 0040 0041 ################# now find all used packages ################# 0042 0043 set (REQUIRED_QT_VERSION 5.15.2) 0044 0045 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus) 0046 0047 find_package(KF5Archive ${KF_DEP_VERSION} REQUIRED) 0048 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED) 0049 find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED) 0050 0051 find_package(KF5DocTools ${KF_DEP_VERSION}) 0052 set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Tools to generate documentation" 0053 TYPE OPTIONAL 0054 ) 0055 0056 ######################################################################### 0057 0058 ecm_setup_qtplugin_macro_names( 0059 JSON_ARG2 0060 "K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON" 0061 CONFIG_CODE_VARIABLE 0062 PACKAGE_SETUP_AUTOMOC_VARIABLES 0063 ) 0064 ecm_set_disabled_deprecation_versions( 0065 QT 5.15.2 0066 KF 5.97 0067 KCOREADDONS 5.91 # KPluginMetaData::fromDesktopFile 0068 ) 0069 0070 include(KF5PackageMacros.cmake) 0071 0072 # make package_version.h available 0073 include_directories(${CMAKE_CURRENT_BINARY_DIR}) 0074 0075 ################# list the subdirectories ################# 0076 if (KF5DocTools_FOUND) 0077 add_subdirectory(docs) 0078 endif() 0079 add_definitions(-DTRANSLATION_DOMAIN=\"libkpackage5\") 0080 ki18n_install(po) 0081 if (KF5DocTools_FOUND) 0082 kdoctools_install(po) 0083 endif() 0084 add_subdirectory(src) 0085 if (BUILD_TESTING) 0086 add_subdirectory(autotests) 0087 endif() 0088 0089 ################ create PackageConfig.cmake and install it #################### 0090 0091 # create a Config.cmake and a ConfigVersion.cmake file and install them 0092 0093 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Package") 0094 0095 if (BUILD_QCH) 0096 ecm_install_qch_export( 0097 TARGETS KF5Package_QCH 0098 FILE KF5PackageQchTargets.cmake 0099 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0100 COMPONENT Devel 0101 ) 0102 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5PackageQchTargets.cmake\")") 0103 endif() 0104 0105 configure_package_config_file( 0106 "${CMAKE_CURRENT_SOURCE_DIR}/KF5PackageConfig.cmake.in" 0107 "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfig.cmake" 0108 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0109 PATH_VARS KDE_INSTALL_INCLUDEDIR_KF CMAKE_INSTALL_PREFIX 0110 ) 0111 0112 install(FILES 0113 qrc.cmake 0114 "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfig.cmake" 0115 "${CMAKE_CURRENT_BINARY_DIR}/KF5PackageConfigVersion.cmake" 0116 "${CMAKE_CURRENT_SOURCE_DIR}/KF5PackageMacros.cmake" 0117 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0118 COMPONENT Devel 0119 ) 0120 0121 install(EXPORT KF5PackageTargets 0122 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0123 FILE KF5PackageTargets.cmake 0124 NAMESPACE KF5:: 0125 COMPONENT Devel) 0126 install(EXPORT KF5PackageToolsTargets 0127 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0128 FILE KF5PackageToolsTargets.cmake 0129 NAMESPACE KF5:: 0130 COMPONENT Devel) 0131 0132 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kpackage_version.h 0133 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPackage COMPONENT Devel ) 0134 0135 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 0136 0137 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)