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