Warning, /frameworks/kxmlgui/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 set(KF_DEP_VERSION "5.249.0") # handled by release scripts
0005 project(KXmlGui VERSION ${KF_VERSION})
0006 
0007 # ECM setup
0008 include(FeatureSummary)
0009 find_package(ECM 5.249.0  NO_MODULE)
0010 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0011 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0012 
0013 
0014 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0015 
0016 include(ECMMarkNonGuiExecutable)
0017 include(ECMSetupVersion)
0018 include(ECMGenerateHeaders)
0019 include(ECMAddQch)
0020 include(ECMGenerateExportHeader)
0021 
0022 include(KDEInstallDirs)
0023 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0024 include(KDECMakeSettings)
0025 include(KDEGitCommitHooks)
0026 include(ECMQtDeclareLoggingCategory)
0027 include(ECMDeprecationSettings)
0028 include(CMakeDependentOption)
0029 
0030 set(kxmlgui_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/kxmlgui_version.h")
0031 ecm_setup_version(PROJECT
0032                   VARIABLE_PREFIX KXMLGUI
0033                   VERSION_HEADER "${kxmlgui_version_header}"
0034                   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6XmlGuiConfigVersion.cmake"
0035                   SOVERSION 6)
0036 
0037 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0038 
0039 option(FORCE_DISABLE_KGLOBALACCEL "Force building KXmlGui without KGlobalAccel. Doing this will break global shortcut support. [default=OFF]" OFF)
0040 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0041 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0042 
0043 cmake_dependent_option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON "NOT CMAKE_CROSSCOMPILING" OFF)
0044 add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
0045 
0046 # Dependencies
0047 set(REQUIRED_QT_VERSION 6.5.0)
0048 find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets Xml Network PrintSupport)
0049 # On non-Apple UNIX DBus is required, on Apple Unix & Windows optional and it does not exist on Android
0050 if(UNIX AND NOT APPLE)
0051     if(NOT ANDROID)
0052         find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
0053     endif()
0054 else()
0055     find_package(Qt6 ${REQUIRED_QT_VERSION} OPTIONAL_COMPONENTS DBus)
0056 endif()
0057 
0058 find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED)
0059 find_package(KF6ItemViews ${KF_DEP_VERSION} REQUIRED)
0060 find_package(KF6Config ${KF_DEP_VERSION} REQUIRED)
0061 find_package(KF6ConfigWidgets ${KF_DEP_VERSION} REQUIRED)
0062 find_package(KF6GuiAddons ${KF_DEP_VERSION} REQUIRED)
0063 find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED)
0064 find_package(KF6IconThemes ${KF_DEP_VERSION} REQUIRED)
0065 find_package(KF6WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
0066 
0067 if (NOT FORCE_DISABLE_KGLOBALACCEL AND NOT WIN32 AND NOT APPLE AND NOT ANDROID)
0068     find_package(KF6GlobalAccel ${KF_DEP_VERSION} REQUIRED)
0069 endif()
0070 set (HAVE_GLOBALACCEL ${KF6GlobalAccel_FOUND})
0071 
0072 ecm_set_disabled_deprecation_versions(
0073     QT 6.5
0074     KF 5.240
0075 )
0076 
0077 add_definitions(-DTRANSLATION_DOMAIN=\"kxmlgui6\")
0078 ki18n_install(po)
0079 
0080 # Subdirectories
0081 add_subdirectory(src)
0082 if (BUILD_TESTING)
0083     add_subdirectory(tests)
0084     add_subdirectory(autotests)
0085 endif()
0086 
0087 # create a Config.cmake and a ConfigVersion.cmake file and install them
0088 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6XmlGui")
0089 
0090 if (BUILD_QCH)
0091     ecm_install_qch_export(
0092         TARGETS KF6XmlGui_QCH
0093         FILE KF6XmlGuiQchTargets.cmake
0094         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0095         COMPONENT Devel
0096     )
0097     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6XmlGuiQchTargets.cmake\")")
0098 endif()
0099 
0100 include(CMakePackageConfigHelpers)
0101 
0102 configure_package_config_file(
0103   "${CMAKE_CURRENT_SOURCE_DIR}/KF6XmlGuiConfig.cmake.in"
0104   "${CMAKE_CURRENT_BINARY_DIR}/KF6XmlGuiConfig.cmake"
0105   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0106 )
0107 
0108 install(FILES
0109   "${CMAKE_CURRENT_BINARY_DIR}/KF6XmlGuiConfig.cmake"
0110   "${CMAKE_CURRENT_BINARY_DIR}/KF6XmlGuiConfigVersion.cmake"
0111   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0112   COMPONENT Devel
0113 )
0114 
0115 install(EXPORT KF6XmlGuiTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6XmlGuiTargets.cmake NAMESPACE KF6:: )
0116 
0117 install(FILES
0118    ${kxmlgui_version_header}
0119   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KXmlGui COMPONENT Devel
0120 )
0121 
0122 include(ECMFeatureSummary)
0123 ecm_feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
0124 
0125 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)