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 "6.0.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.249.0") # handled by release scripts
0005 project(KPackage VERSION ${KF_VERSION})
0006 
0007 # ECM setup
0008 include(FeatureSummary)
0009 find_package(ECM 5.249.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(ECMDeprecationSettings)
0028 
0029 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0030 
0031 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0032 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0033 
0034 set(kpackage_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/kpackage/kpackage_version.h")
0035 ecm_setup_version(PROJECT
0036                   VARIABLE_PREFIX PACKAGE
0037                   VERSION_HEADER "${kpackage_version_header}"
0038                   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfigVersion.cmake"
0039                   SOVERSION 6)
0040 
0041 ################# now find all used packages #################
0042 
0043 set (REQUIRED_QT_VERSION 6.5.0)
0044 
0045 find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core DBus)
0046 
0047 find_package(KF6Archive ${KF_DEP_VERSION} REQUIRED)
0048 find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED)
0049 find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED)
0050 
0051 find_package(KF6DocTools ${KF_DEP_VERSION})
0052 set_package_properties(KF6DocTools PROPERTIES DESCRIPTION "Tools to generate documentation"
0053                        TYPE OPTIONAL
0054                       )
0055 
0056 ecm_set_disabled_deprecation_versions(
0057     QT 6.5
0058     KF 5.239
0059 )
0060 
0061 include(KF6PackageMacros.cmake)
0062 
0063 # make package_version.h available
0064 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0065 
0066 ################# list the subdirectories #################
0067 if (KF6DocTools_FOUND)
0068     add_subdirectory(docs)
0069 endif()
0070 add_definitions(-DTRANSLATION_DOMAIN=\"libkpackage6\")
0071 ki18n_install(po)
0072 if (KF6DocTools_FOUND)
0073     kdoctools_install(po)
0074 endif()
0075 add_subdirectory(src)
0076 if (BUILD_TESTING)
0077     add_subdirectory(autotests)
0078 endif()
0079 
0080 ################ create PackageConfig.cmake and install it ####################
0081 
0082 # create a Config.cmake and a ConfigVersion.cmake file and install them
0083 
0084 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Package")
0085 
0086 if (BUILD_QCH)
0087     ecm_install_qch_export(
0088         TARGETS KF6Package_QCH
0089         FILE KF6PackageQchTargets.cmake
0090         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0091         COMPONENT Devel
0092     )
0093     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6PackageQchTargets.cmake\")")
0094 endif()
0095 
0096 configure_package_config_file(
0097   "${CMAKE_CURRENT_SOURCE_DIR}/KF6PackageConfig.cmake.in"
0098   "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfig.cmake"
0099   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0100   PATH_VARS  KDE_INSTALL_INCLUDEDIR_KF CMAKE_INSTALL_PREFIX
0101 )
0102 
0103 install(FILES
0104   "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfig.cmake"
0105   "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfigVersion.cmake"
0106   "${CMAKE_CURRENT_SOURCE_DIR}/KF6PackageMacros.cmake"
0107   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0108   COMPONENT Devel
0109 )
0110 
0111 install(EXPORT KF6PackageTargets
0112         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0113         FILE KF6PackageTargets.cmake
0114         NAMESPACE KF6::
0115         COMPONENT Devel)
0116 install(EXPORT KF6PackageToolsTargets
0117         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0118         FILE KF6PackageToolsTargets.cmake
0119         NAMESPACE KF6::
0120         COMPONENT Devel)
0121 
0122 install(FILES ${kpackage_version_header}
0123         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPackage COMPONENT Devel )
0124 
0125 include(ECMFeatureSummary)
0126 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0127 
0128 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)