Warning, /frameworks/kjobwidgets/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.97.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.97.0") # handled by release scripts
0005 project(KJobWidgets VERSION ${KF_VERSION})
0006 
0007 include(FeatureSummary)
0008 find_package(ECM 5.97.0  NO_MODULE)
0009 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0010 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0011 
0012 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0013 
0014 include(KDEInstallDirs)
0015 include(KDECMakeSettings)
0016 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0017 
0018 include(KDEGitCommitHooks)
0019 include(ECMQtDeclareLoggingCategory)
0020 include(ECMPoQmTools)
0021 include(ECMGenerateExportHeader)
0022 include(ECMSetupVersion)
0023 include(ECMGenerateHeaders)
0024 include(ECMDeprecationSettings)
0025 include(ECMAddQch)
0026 include(CMakePackageConfigHelpers)
0027 
0028 set(REQUIRED_QT_VERSION 5.15.2)
0029 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets)
0030 
0031 if (NOT ANDROID)
0032     find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
0033 endif()
0034 if (NOT APPLE)
0035     find_package(X11)
0036 endif()
0037 
0038 set(HAVE_X11 ${X11_FOUND})
0039 
0040 if (HAVE_X11)
0041     if (QT_MAJOR_VERSION STREQUAL "5")
0042         find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
0043     else()
0044         # qtx11extras_p.h is in Qt6Gui, which implied by the Qt6Widgets above
0045     endif()
0046 endif()
0047 
0048 find_package(KF5CoreAddons ${KF_DEP_VERSION} REQUIRED)
0049 find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
0050 
0051 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0052 
0053 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0054 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0055 
0056 ecm_setup_version(PROJECT VARIABLE_PREFIX KJOBWIDGETS
0057                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kjobwidgets_version.h"
0058                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5JobWidgetsConfigVersion.cmake"
0059                         SOVERSION 5)
0060 
0061 ecm_set_disabled_deprecation_versions(
0062     QT 5.15.2
0063     KF 5.95
0064 )
0065 
0066 ecm_install_po_files_as_qm(po)
0067 
0068 add_subdirectory(src)
0069 if (BUILD_TESTING)
0070     add_subdirectory(tests)
0071     add_subdirectory(autotests)
0072 endif()
0073 
0074 # create a Config.cmake and a ConfigVersion.cmake file and install them
0075 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5JobWidgets")
0076 
0077 if (BUILD_QCH)
0078     ecm_install_qch_export(
0079         TARGETS KF5JobWidgets_QCH
0080         FILE KF5JobWidgetsQchTargets.cmake
0081         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0082         COMPONENT Devel
0083     )
0084     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5JobWidgetsQchTargets.cmake\")")
0085 endif()
0086 
0087 configure_package_config_file(
0088   "${CMAKE_CURRENT_SOURCE_DIR}/KF5JobWidgetsConfig.cmake.in"
0089   "${CMAKE_CURRENT_BINARY_DIR}/KF5JobWidgetsConfig.cmake"
0090   PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
0091   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0092 )
0093 
0094 install(FILES
0095   "${CMAKE_CURRENT_BINARY_DIR}/KF5JobWidgetsConfig.cmake"
0096   "${CMAKE_CURRENT_BINARY_DIR}/KF5JobWidgetsConfigVersion.cmake"
0097   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0098   COMPONENT Devel
0099 )
0100 
0101 install(EXPORT KF5JobWidgetsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5JobWidgetsTargets.cmake NAMESPACE KF5:: )
0102 
0103 install(FILES
0104    ${CMAKE_CURRENT_BINARY_DIR}/kjobwidgets_version.h
0105   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KJobWidgets COMPONENT Devel
0106 )
0107 
0108 feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)
0109 
0110 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)