Warning, /frameworks/kglobalaccel/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.105.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.104.0") # handled by release scripts
0005 project(KGlobalAccel VERSION ${KF_VERSION})
0006 
0007 # ECM setup
0008 include(FeatureSummary)
0009 find_package(ECM 5.104.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(CMakePackageConfigHelpers)
0022 include(ECMSetupVersion)
0023 include(ECMGenerateHeaders)
0024 include(ECMAddQch)
0025 include(ECMMarkNonGuiExecutable)
0026 include(ECMQtDeclareLoggingCategory)
0027 include(ECMPoQmTools)
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_RUNTIME "Build the kglobalacceld runtime" ON)
0033 add_feature_info(BUILD_RUNTIME ${BUILD_RUNTIME} "The kglobalacceld runtime")
0034 
0035 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0036 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0037 
0038 ecm_setup_version(PROJECT VARIABLE_PREFIX KGLOBALACCEL
0039                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kglobalaccel_version.h"
0040                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5GlobalAccelConfigVersion.cmake"
0041                         SOVERSION 5)
0042 
0043 # Dependencies
0044 set(REQUIRED_QT_VERSION 5.15.2)
0045 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus Widgets)
0046 
0047 # Dependencies of runtime component
0048 if (BUILD_RUNTIME)
0049     find_package(KF5Config ${KF_DEP_VERSION} REQUIRED)
0050     find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED)
0051     find_package(KF5Crash ${KF_DEP_VERSION} REQUIRED)
0052     find_package(KF5DBusAddons ${KF_DEP_VERSION} REQUIRED)
0053     find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED)
0054 endif()
0055 
0056 # no X11 stuff on mac
0057 if (BUILD_RUNTIME AND NOT APPLE)
0058     find_package(XCB MODULE COMPONENTS XCB KEYSYMS XKB RECORD OPTIONAL_COMPONENTS XTEST)
0059     set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
0060                        TYPE OPTIONAL
0061                       )
0062 
0063     find_package(X11)
0064 endif()
0065 
0066 set(HAVE_X11 0)
0067 
0068 if(X11_FOUND AND XCB_XCB_FOUND)
0069     set(HAVE_X11 1)
0070     if (QT_MAJOR_VERSION STREQUAL "5")
0071         find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
0072     elseif (QT_MAJOR_VERSION STREQUAL "6")
0073         find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui) # qtx11extras_p.h
0074     endif()
0075 endif()
0076 
0077 ecm_set_disabled_deprecation_versions(
0078     QT 5.15.2
0079     KF 5.95.0
0080 )
0081 
0082 # Subdirectories
0083 ecm_install_po_files_as_qm(poqm)
0084 
0085 add_subdirectory(src)
0086 if (BUILD_TESTING)
0087     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
0088 
0089     add_subdirectory(tests)
0090     add_subdirectory(autotests)
0091 endif()
0092 
0093 # create a Config.cmake and a ConfigVersion.cmake file and install them
0094 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5GlobalAccel")
0095 
0096 if (BUILD_QCH)
0097     ecm_install_qch_export(
0098         TARGETS KF5GlobalAccel_QCH
0099         FILE KF5GlobalAccelQchTargets.cmake
0100         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0101         COMPONENT Devel
0102     )
0103     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5GlobalAccelQchTargets.cmake\")")
0104 endif()
0105 
0106 configure_package_config_file(
0107     "${CMAKE_CURRENT_SOURCE_DIR}/KF5GlobalAccelConfig.cmake.in"
0108     "${CMAKE_CURRENT_BINARY_DIR}/KF5GlobalAccelConfig.cmake"
0109     PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0110     INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0111 )
0112 
0113 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF5GlobalAccelConfig.cmake"
0114                "${CMAKE_CURRENT_BINARY_DIR}/KF5GlobalAccelConfigVersion.cmake"
0115         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0116         COMPONENT Devel )
0117 
0118 install(EXPORT KF5GlobalAccelTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5GlobalAccelTargets.cmake NAMESPACE KF5:: )
0119 
0120 
0121 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kglobalaccel_version.h
0122         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KGlobalAccel COMPONENT Devel)
0123 
0124 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0125 
0126 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)