Warning, /frameworks/knewstuff/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: KDE Contributors
0002 # SPDX-License-Identifier: BSD-2-Clause
0003 
0004 cmake_minimum_required(VERSION 3.16)
0005 
0006 set(KF_VERSION "6.0.0") # handled by release scripts
0007 set(KF_DEP_VERSION "5.249.0") # handled by release scripts
0008 project(KNewStuff VERSION ${KF_VERSION})
0009 
0010 set(CMAKE_CXX_EXTENSIONS OFF)
0011 
0012 include(FeatureSummary)
0013 find_package(ECM 5.249.0 NO_MODULE)
0014 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0015 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0016 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0017 
0018 include(KDEInstallDirs)
0019 include(KDECMakeSettings)
0020 
0021 include(ECMQmlModule)
0022 include(ECMQtDeclareLoggingCategory)
0023 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0024 
0025 set(REQUIRED_QT_VERSION 6.5.0)
0026 find_package(Qt6 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS Gui Widgets Xml Qml Quick QuickWidgets)
0027 find_package(KF6Archive ${KF_DEP_VERSION} REQUIRED)
0028 find_package(KF6Config ${KF_DEP_VERSION} REQUIRED)
0029 find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED)
0030 find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED)
0031 find_package(KF6Package ${KF_DEP_VERSION} REQUIRED)
0032 find_package(KF6WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
0033 
0034 include(ECMGenerateExportHeader)
0035 include(ECMSetupVersion)
0036 include(ECMGenerateHeaders)
0037 include(ECMAddQch)
0038 include(ECMDeprecationSettings)
0039 include(KDEClangFormat)
0040 include(KDEGitCommitHooks)
0041 include(CMakeDependentOption)
0042 
0043 find_package(KF6Attica ${KF_DEP_VERSION} CONFIG REQUIRED)
0044 set_package_properties(KF6Attica PROPERTIES DESCRIPTION "A Qt library that implements the Open Collaboration Services API"
0045                        PURPOSE "Support for Get Hot New Stuff in KNewStuff"
0046                        URL "https://commits.kde.org/attica"
0047                        TYPE REQUIRED
0048                       )
0049 find_package(KF6Kirigami2 2.12.0)
0050 set_package_properties(KF6Kirigami2 PROPERTIES
0051     DESCRIPTION "KDE's lightweight user interface framework for mobile and convergent applications"
0052     URL "https://techbase.kde.org/Kirigami"
0053     PURPOSE "Required by KNewStuffQuick's qml components"
0054     TYPE RUNTIME)
0055 
0056 find_package(KF6Syndication ${KF6_DEP_VERSION})
0057 set_package_properties(KF6Syndication PROPERTIES
0058     DESCRIPTION "KDE's RSS/Atom parser library"
0059     PURPOSE "Used by the OPDS provider to handle most of the parsing."
0060     TYPE OPTIONAL
0061 )
0062 
0063 
0064 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0065 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0066 
0067 cmake_dependent_option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON "NOT CMAKE_CROSSCOMPILING" OFF)
0068 add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
0069 
0070 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0071 
0072 ecm_setup_version(PROJECT VARIABLE_PREFIX KNEWSTUFF
0073                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/knewstuff_version.h"
0074                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffConfigVersion.cmake"
0075                         SOVERSION 6)
0076 ecm_setup_version(PROJECT VARIABLE_PREFIX KNEWSTUFFCORE
0077                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffCoreConfigVersion.cmake"
0078                         SOVERSION 6)
0079 ecm_setup_version(PROJECT VARIABLE_PREFIX KNEWSTUFFWIDGETS
0080                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffWidgetsConfigVersion.cmake"
0081                         SOVERSION 6)
0082 
0083 add_definitions(-DTRANSLATION_DOMAIN=\"knewstuff6\")
0084 ecm_set_disabled_deprecation_versions(
0085     QT 6.5.0
0086     KF 5.102
0087 )
0088 
0089 ki18n_install(po)
0090 add_subdirectory(src)
0091 if (BUILD_TESTING)
0092     add_subdirectory(autotests)
0093 endif()
0094 
0095 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6NewStuff")
0096 set(CMAKECONFIG_CORE_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6NewStuffCore")
0097 
0098 if (BUILD_QCH)
0099     ecm_install_qch_export(
0100         TARGETS KF6NewStuff_QCH
0101         FILE KF6NewStuffQchTargets.cmake
0102         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0103         COMPONENT Devel
0104     )
0105     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6NewStuffQchTargets.cmake\")")
0106     ecm_install_qch_export(
0107         TARGETS KF6NewStuffCore_QCH
0108         FILE KF6NewStuffCoreQchTargets.cmake
0109         DESTINATION "${CMAKECONFIG_CORE_INSTALL_DIR}"
0110         COMPONENT Devel
0111     )
0112     set(PACKAGE_INCLUDE_CORE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6NewStuffCoreQchTargets.cmake\")")
0113     # TODO: KF6NewStuffQuick
0114 endif()
0115 
0116 include(CMakePackageConfigHelpers)
0117 
0118 configure_package_config_file(
0119   "${CMAKE_CURRENT_SOURCE_DIR}/KF6NewStuffConfig.cmake.in"
0120   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffConfig.cmake"
0121   INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0122 )
0123 
0124 configure_package_config_file(
0125   "${CMAKE_CURRENT_SOURCE_DIR}/KF6NewStuffCoreConfig.cmake.in"
0126   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffCoreConfig.cmake"
0127   INSTALL_DESTINATION ${CMAKECONFIG_CORE_INSTALL_DIR}
0128 )
0129 
0130 install(FILES
0131   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffConfig.cmake"
0132   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffConfigVersion.cmake"
0133   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0134   COMPONENT Devel
0135 )
0136 install(FILES
0137   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffCoreConfig.cmake"
0138   "${CMAKE_CURRENT_BINARY_DIR}/KF6NewStuffCoreConfigVersion.cmake"
0139   DESTINATION "${CMAKECONFIG_CORE_INSTALL_DIR}"
0140   COMPONENT Devel
0141 )
0142 
0143 install(EXPORT KF6NewStuffTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF6NewStuffTargets.cmake NAMESPACE KF6::)
0144 install(EXPORT KF6NewStuffCoreTargets DESTINATION "${CMAKECONFIG_CORE_INSTALL_DIR}" FILE KF6NewStuffCoreTargets.cmake NAMESPACE KF6::)
0145 
0146 install(
0147   FILES ${CMAKE_CURRENT_BINARY_DIR}/knewstuff_version.h
0148   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KNewStuff
0149   COMPONENT Devel
0150 )
0151 
0152 include(ECMFeatureSummary)
0153 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0154 
0155 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)