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