Warning, /frameworks/kcmutils/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.99.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.99.0") # handled by release scripts
0005 project(KCMUtils VERSION ${KF_VERSION})
0006 
0007 include(FeatureSummary)
0008 find_package(ECM 5.99.0  NO_MODULE)
0009 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0010 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0011 
0012 
0013 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0014 
0015 include(KDEInstallDirs)
0016 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0017 include(KDECMakeSettings)
0018 
0019 include(ECMGenerateExportHeader)
0020 include(ECMSetupVersion)
0021 include(ECMGenerateHeaders)
0022 include(CMakePackageConfigHelpers)
0023 include(ECMAddQch)
0024 include(ECMQtDeclareLoggingCategory)
0025 include(ECMSetupQtPluginMacroNames)
0026 include(ECMDeprecationSettings)
0027 include(KDEGitCommitHooks)
0028 
0029 
0030 include(CMakeDependentOption)
0031 option(TOOLS_ONLY "Only build the tools and not the rest of KCMUtils" OFF)
0032 if (TOOLS_ONLY)
0033     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Core)
0034     add_subdirectory(tools)
0035     return()
0036 endif()
0037 
0038 set(REQUIRED_QT_VERSION 5.15.2)
0039 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Widgets DBus Qml Quick QuickWidgets Test)
0040 
0041 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0042 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0043 
0044 ecm_setup_version(PROJECT VARIABLE_PREFIX KCMUTILS
0045                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcmutils_version.h"
0046                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KCMUtilsConfigVersion.cmake"
0047                         SOVERSION 5)
0048 
0049 find_package(KF5ItemViews ${KF_DEP_VERSION} REQUIRED)
0050 find_package(KF5ConfigWidgets ${KF_DEP_VERSION} REQUIRED)
0051 find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED)
0052 find_package(KF5GuiAddons ${KF_DEP_VERSION} REQUIRED)
0053 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED)
0054 find_package(KF5Service ${KF_DEP_VERSION} REQUIRED)
0055 find_package(KF5XmlGui ${KF_DEP_VERSION} REQUIRED)
0056 find_package(KF5Declarative ${KF_DEP_VERSION} REQUIRED)
0057 
0058 ecm_setup_qtplugin_macro_names(
0059     JSON_NONE
0060         "KCMODULECONTAINER"
0061     CONFIG_CODE_VARIABLE
0062         PACKAGE_SETUP_AUTOMOC_VARIABLES
0063 )
0064 
0065 ecm_set_disabled_deprecation_versions(
0066     QT 5.15.2
0067     KF 5.90.0
0068     KSERVICE 5.78 # for KPluginInfo::dependencies
0069     KCOREADDONS 5.78 # for KPluginInfo::dependencies
0070     QUICKADDONS 5.87 # for ConfigModule::aboutData
0071     KCONFIGWIDGETS 5.84 # for KCModule::aboutData and corresponding constructor
0072 )
0073 
0074 add_definitions(-DTRANSLATION_DOMAIN=\"kcmutils5\")
0075 ki18n_install(po)
0076 add_subdirectory(tools)
0077 add_subdirectory(src)
0078 if(BUILD_TESTING)
0079 add_subdirectory(autotests)
0080 endif()
0081 
0082 
0083 # create a Config.cmake and a ConfigVersion.cmake file and install them
0084 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KCMUtils")
0085 
0086 if (BUILD_QCH)
0087     ecm_install_qch_export(
0088         TARGETS KF5KCMUtils_QCH
0089         FILE KF5KCMUtilsQchTargets.cmake
0090         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0091         COMPONENT Devel
0092     )
0093     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5KCMUtilsQchTargets.cmake\")")
0094 endif()
0095 
0096 configure_package_config_file(
0097   "${CMAKE_CURRENT_SOURCE_DIR}/KF5KCMUtilsConfig.cmake.in"
0098   "${CMAKE_CURRENT_BINARY_DIR}/KF5KCMUtilsConfig.cmake"
0099   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0100 )
0101 
0102 install(FILES
0103   "${CMAKE_CURRENT_BINARY_DIR}/KF5KCMUtilsConfig.cmake"
0104   "${CMAKE_CURRENT_BINARY_DIR}/KF5KCMUtilsConfigVersion.cmake"
0105   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0106   COMPONENT Devel
0107 )
0108 
0109 install(
0110     FILES
0111     ${CMAKE_CURRENT_SOURCE_DIR}/KF5KCMUtilsMacros.cmake
0112     ${CMAKE_CURRENT_SOURCE_DIR}/src/kcmutilsgeneratemoduledata.cpp.in
0113     ${CMAKE_CURRENT_SOURCE_DIR}/src/kcmutilsgeneratemoduledata.h.in
0114     DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0115 )
0116 
0117 install(EXPORT KF5KCMUtilsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KCMUtilsTargets.cmake NAMESPACE KF5:: )
0118 
0119 install(FILES
0120    ${CMAKE_CURRENT_BINARY_DIR}/kcmutils_version.h
0121   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KCMUtils COMPONENT Devel
0122 )
0123 
0124 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0125 
0126 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)