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 "5.116.0") # handled by release scripts
0004 project(KGuiAddons VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.115.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(GenerateExportHeader)
0024 include(ECMMarkNonGuiExecutable)
0025 
0026 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0027 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0028 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)
0029 
0030 if (UNIX AND NOT ANDROID AND NOT APPLE)
0031     option(WITH_WAYLAND "Build with support for KModifierKeyInfo, KSystemClipboard and KeySequenceRecorder inhibiting shortcuts on Wayland" ON)
0032     add_feature_info(WAYLAND ${WITH_WAYLAND} "KeySequenceEditor inhibiting shortcuts on Wayland")
0033 
0034     option(WITH_X11 "Build with support for KModifierKeyInfo on X11" ON)
0035     add_feature_info(X11 ${WITH_X11} "KeySequenceEditor inhibiting shortcuts on X11")
0036 
0037     option(WITH_DBUS "Build with support for color scheme information via XDG portals" ON)
0038 
0039 else()
0040     set(WITH_WAYLAND OFF)
0041     set(WITH_X11 OFF)
0042     set(WITH_DBUS OFF)
0043 endif()
0044 
0045 set(REQUIRED_QT_VERSION 5.15.2)
0046 if (WITH_WAYLAND)
0047     set(_qtgui_find_components COMPONENTS Private)
0048 endif()
0049 # QtGui must be found before Qt5WaylandClient
0050 find_package(Qt${QT_MAJOR_VERSION}Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE ${_qtgui_find_components})
0051 
0052 if (WITH_X11)
0053     find_package(X11 REQUIRED MODULE)
0054     find_package(XCB REQUIRED MODULE COMPONENTS XCB)
0055     if (QT_MAJOR_VERSION STREQUAL "5")
0056         find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED CONFIG)
0057     endif()
0058 endif()
0059 
0060 if (WITH_WAYLAND)
0061     find_package(PlasmaWaylandProtocols 1.7.0 REQUIRED)
0062     find_package(Qt${QT_MAJOR_VERSION}WaylandClient ${REQUIRED_QT_VERSION} REQUIRED CONFIG)
0063     # With Qt6 use qt_generate_wayland_protocol_client_sources instead of
0064     # ecm_add_qtwayland_client_protocol (in QtWaylandScanner from ECM)
0065     if (NOT TARGET Qt6::WaylandClient)
0066         find_package(QtWaylandScanner REQUIRED)
0067     endif()
0068     find_package(Wayland 1.9 REQUIRED Client)
0069 endif()
0070 
0071 if (WITH_DBUS)
0072     find_package(Qt${QT_MAJOR_VERSION}DBus ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
0073 endif()
0074 
0075 ecm_setup_version(PROJECT VARIABLE_PREFIX KGUIADDONS
0076                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kguiaddons_version.h"
0077                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5GuiAddonsConfigVersion.cmake"
0078                         SOVERSION 5)
0079 
0080 ecm_set_disabled_deprecation_versions(
0081     QT 5.15.2
0082 )
0083 
0084 add_subdirectory(src)
0085 if (BUILD_TESTING)
0086     add_subdirectory(autotests)
0087     add_subdirectory(tests)
0088 endif()
0089 
0090 # create a Config.cmake and a ConfigVersion.cmake file and install them
0091 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5GuiAddons")
0092 
0093 if (BUILD_QCH)
0094     ecm_install_qch_export(
0095         TARGETS KF5GuiAddons_QCH
0096         FILE KF5GuiAddonsQchTargets.cmake
0097         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0098         COMPONENT Devel
0099     )
0100     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5GuiAddonsQchTargets.cmake\")")
0101 endif()
0102 
0103 include(CMakePackageConfigHelpers)
0104 
0105 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF5GuiAddonsConfig.cmake.in"
0106                               "${CMAKE_CURRENT_BINARY_DIR}/KF5GuiAddonsConfig.cmake"
0107                               INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0108                               )
0109 
0110 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF5GuiAddonsConfig.cmake"
0111                "${CMAKE_CURRENT_BINARY_DIR}/KF5GuiAddonsConfigVersion.cmake"
0112         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0113         COMPONENT Devel )
0114 
0115 
0116 install(EXPORT KF5GuiAddonsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0117         FILE KF5GuiAddonsTargets.cmake NAMESPACE KF5:: COMPONENT Devel)
0118 
0119 
0120 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kguiaddons_version.h
0121         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KGuiAddons COMPONENT Devel)
0122 
0123 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0124 
0125 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)