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