Warning, /frameworks/kguiaddons/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 project(KGuiAddons VERSION ${KF_VERSION}) 0005 0006 include(FeatureSummary) 0007 find_package(ECM 5.249.0 NO_MODULE) 0008 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 0009 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 0010 0011 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) 0012 0013 include(KDEInstallDirs) 0014 include(KDECMakeSettings) 0015 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 0016 0017 include(KDEGitCommitHooks) 0018 include(ECMSetupVersion) 0019 include(ECMGenerateHeaders) 0020 include(ECMQtDeclareLoggingCategory) 0021 include(ECMDeprecationSettings) 0022 include(ECMAddQch) 0023 include(ECMGenerateExportHeader) 0024 include(ECMGeneratePkgConfigFile) 0025 include(ECMMarkNonGuiExecutable) 0026 0027 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) 0028 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") 0029 option(BUILD_GEO_SCHEME_HANDLER "Build the geo: URI scheme handler. Disable this if you are building two major versions for co-installability in the older variant." ON) 0030 0031 if (UNIX AND NOT ANDROID AND NOT APPLE) 0032 option(WITH_WAYLAND "Build with support for KModifierKeyInfo, KSystemClipboard and KKeySequenceRecorder inhibiting shortcuts on Wayland" ON) 0033 add_feature_info(WAYLAND ${WITH_WAYLAND} "KeySequenceEditor inhibiting shortcuts on Wayland") 0034 0035 option(WITH_X11 "Build with support for KModifierKeyInfo on X11" ON) 0036 add_feature_info(X11 ${WITH_X11} "KeySequenceEditor inhibiting shortcuts on X11") 0037 0038 option(WITH_DBUS "Build with support for color scheme information via XDG portals" ON) 0039 0040 else() 0041 set(WITH_WAYLAND OFF) 0042 set(WITH_X11 OFF) 0043 set(WITH_DBUS OFF) 0044 endif() 0045 0046 set(REQUIRED_QT_VERSION 6.5.0) 0047 if (WITH_WAYLAND) 0048 set(_qtgui_find_components COMPONENTS Private) 0049 endif() 0050 # QtGui must be found before Qt5WaylandClient 0051 find_package(Qt6Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE ${_qtgui_find_components}) 0052 0053 if (WITH_X11) 0054 find_package(X11 REQUIRED MODULE) 0055 find_package(XCB REQUIRED MODULE COMPONENTS XCB) 0056 endif() 0057 0058 if (WITH_WAYLAND) 0059 find_package(PlasmaWaylandProtocols 1.10.0 REQUIRED) 0060 find_package(Qt6WaylandClient ${REQUIRED_QT_VERSION} REQUIRED CONFIG) 0061 find_package(Wayland 1.9 REQUIRED Client) 0062 endif() 0063 0064 if (WITH_DBUS) 0065 find_package(Qt6DBus ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) 0066 endif() 0067 0068 set(kguiaddons_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/kguiaddons_version.h") 0069 ecm_setup_version(PROJECT VARIABLE_PREFIX KGUIADDONS 0070 VERSION_HEADER "${kguiaddons_version_header}" 0071 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6GuiAddonsConfigVersion.cmake" 0072 SOVERSION 6) 0073 0074 ecm_set_disabled_deprecation_versions( 0075 QT 6.5 0076 ) 0077 0078 add_subdirectory(src) 0079 if (BUILD_TESTING) 0080 add_subdirectory(autotests) 0081 add_subdirectory(tests) 0082 endif() 0083 0084 # create a Config.cmake and a ConfigVersion.cmake file and install them 0085 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6GuiAddons") 0086 0087 if (BUILD_QCH) 0088 ecm_install_qch_export( 0089 TARGETS KF6GuiAddons_QCH 0090 FILE KF6GuiAddonsQchTargets.cmake 0091 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0092 COMPONENT Devel 0093 ) 0094 set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6GuiAddonsQchTargets.cmake\")") 0095 endif() 0096 0097 include(CMakePackageConfigHelpers) 0098 0099 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF6GuiAddonsConfig.cmake.in" 0100 "${CMAKE_CURRENT_BINARY_DIR}/KF6GuiAddonsConfig.cmake" 0101 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 0102 ) 0103 0104 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF6GuiAddonsConfig.cmake" 0105 "${CMAKE_CURRENT_BINARY_DIR}/KF6GuiAddonsConfigVersion.cmake" 0106 DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0107 COMPONENT Devel ) 0108 0109 0110 install(EXPORT KF6GuiAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 0111 FILE KF6GuiAddonsTargets.cmake NAMESPACE KF6:: COMPONENT Devel) 0112 0113 0114 install(FILES ${kguiaddons_version_header} 0115 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KGuiAddons COMPONENT Devel) 0116 0117 if (NOT WIN32) 0118 ecm_generate_pkgconfig_file(BASE_NAME KF6GuiAddons 0119 INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KGuiAddons 0120 DEPS Qt6Gui 0121 INSTALL) 0122 endif() 0123 0124 include(ECMFeatureSummary) 0125 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 0126 0127 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)