Warning, /plasma/kglobalacceld/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 project(kglobalacceld)
0004 
0005 set(PROJECT_VERSION "6.0.80")
0006 set(PROJECT_VERSION_MAJOR 6)
0007 
0008 set(QT_MIN_VERSION "6.6.0")
0009 set(KF6_MIN_VERSION "5.240.0")
0010 
0011 set(CMAKE_CXX_STANDARD 20)
0012 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0013 
0014 include(FeatureSummary)
0015 find_package(ECM ${KF6_MIN_VERSION}  NO_MODULE)
0016 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0017 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0018 
0019 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0020 
0021 include(KDEInstallDirs)
0022 include(KDECMakeSettings)
0023 include(KDEGitCommitHooks)
0024 include(KDECompilerSettings NO_POLICY_SCOPE)
0025 
0026 include(ECMGenerateExportHeader)
0027 include(CMakePackageConfigHelpers)
0028 include(ECMSetupVersion)
0029 include(ECMGenerateHeaders)
0030 include(ECMQtDeclareLoggingCategory)
0031 include(ECMPoQmTools)
0032 include(ECMDeprecationSettings)
0033 include(KDEClangFormat)
0034 include(ECMAddTests)
0035 
0036 # When kglobalacceld was still in frameworks/kglobalaccel and KF5-time deprecated API was dropped there,
0037 # some deprecated stuff in kglobalacceld was kept: "needs more consideration since it might break older consumers"
0038 # Early build setups for Qt6/KF6-based software externally set EXCLUDE_DEPRECATED_BEFORE_AND_AT to 5.99,
0039 # and accidentally for any repos, not just KF modules, so also with other version schemes.
0040 # Also should defaults be set by the software itself.
0041 # While the deprecated stuff is still around and waiting for being sorted out, set ourselves the
0042 # expected czrrent default value for EXCLUDE_DEPRECATED_BEFORE_AND_AT, to achieve consistent builds (and set of available API).
0043 # Note the deprecated API also still uses the KF version scheme, which works for now while no additional API is deprecated.
0044 # TODO: sort out where KF5-time deprecated API still is needed and undeprecate it, remove the rest, then return to using 0 here
0045 if (TRUE)
0046 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 5.99.0 CACHE STRING "Control the range of deprecated API excluded from the build [default=5.99.0].")
0047 else() # normal
0048 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0049 endif()
0050 
0051 find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED DBus Gui Widgets)
0052 
0053 find_package(KF6Config ${KF6_MIN_VERSION} REQUIRED)
0054 find_package(KF6CoreAddons ${KF6_MIN_VERSION} REQUIRED)
0055 find_package(KF6Crash ${KF6_MIN_VERSION} REQUIRED)
0056 find_package(KF6DBusAddons ${KF6_MIN_VERSION} REQUIRED)
0057 find_package(KF6WindowSystem ${KF6_MIN_VERSION} REQUIRED)
0058 find_package(KF6GlobalAccel ${KF6_MIN_VERSION} REQUIRED)
0059 find_package(KF6Service ${KF6_MIN_VERSION} REQUIRED)
0060 find_package(KF6KIO ${KF6_MIN_VERSION} REQUIRED)
0061 find_package(KF6JobWidgets ${KF6_MIN_VERSION} REQUIRED)
0062 
0063 
0064 option(WITH_X11 "Build with X11 support." ON)
0065 
0066 if(WITH_X11)
0067     find_package(XCB MODULE COMPONENTS XCB KEYSYMS XKB RECORD OPTIONAL_COMPONENTS XTEST)
0068     set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding"
0069                         TYPE REQUIRED
0070                         )
0071     set(HAVE_X11 1)
0072 else()
0073     set(HAVE_X11 0)
0074 endif()
0075 
0076 find_program(qdbus_EXECUTABLE NAMES qdbus qdbus6 qdbus-qt6)
0077 
0078 if (NOT qdbus_EXECUTABLE)
0079     message("fall")
0080     set(qdbus_EXECUTABLE "qdbus")
0081 endif()
0082 
0083 ecm_setup_version(PROJECT VARIABLE_PREFIX KGLOBALACCELD
0084                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KGlobalAccelDConfigVersion.cmake"
0085                         SOVERSION 0)
0086 
0087 ecm_set_disabled_deprecation_versions(
0088     QT 6.6.0
0089     KF 5.240.0
0090 )
0091 
0092 add_subdirectory(src)
0093 
0094 if(BUILD_TESTING)
0095     add_subdirectory(autotests)
0096 endif()
0097 
0098 # create a Config.cmake and a ConfigVersion.cmake file and install them
0099 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KGlobalAccelD")
0100 
0101 configure_package_config_file(
0102     "${CMAKE_CURRENT_SOURCE_DIR}/KGlobalAccelDConfig.cmake.in"
0103     "${CMAKE_CURRENT_BINARY_DIR}/KGlobalAccelDConfig.cmake"
0104     PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0105     INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0106 )
0107 
0108 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KGlobalAccelDConfig.cmake"
0109                "${CMAKE_CURRENT_BINARY_DIR}/KGlobalAccelDConfigVersion.cmake"
0110         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0111         COMPONENT Devel )
0112 
0113 install(EXPORT KGlobalAccelDTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KGlobalAccelDTargets.cmake NAMESPACE K:: )
0114 
0115 
0116 install(FILES ${kglobalaccel_version_header}
0117         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KGlobalAccel COMPONENT Devel)
0118 
0119 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0120 
0121 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
0122 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0123 
0124 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)