Warning, /frameworks/kdeclarative/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.116.0") # handled by release scripts
0004 set(KF_DEP_VERSION "5.115.0") # handled by release scripts
0005 project(KDeclarative VERSION ${KF_VERSION})
0006 
0007 # Dependencies
0008 include(FeatureSummary)
0009 find_package(ECM 5.115.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 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0014 
0015 set(REQUIRED_QT_VERSION 5.15.2)
0016 
0017 include(KDEInstallDirs)
0018 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED Qml Quick Gui)
0019 
0020 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0021 include(KDECMakeSettings)
0022 include(KDEGitCommitHooks)
0023 include(ECMDeprecationSettings)
0024 
0025 find_package(KF5Config ${KF_DEP_VERSION} REQUIRED)
0026 find_package(KF5I18n ${KF_DEP_VERSION} REQUIRED)
0027 find_package(KF5IconThemes ${KF_DEP_VERSION} REQUIRED)
0028 find_package(KF5KIO ${KF_DEP_VERSION} REQUIRED)
0029 find_package(KF5WidgetsAddons ${KF_DEP_VERSION} REQUIRED)
0030 find_package(KF5WindowSystem ${KF_DEP_VERSION} REQUIRED)
0031 find_package(KF5GuiAddons ${KF_DEP_VERSION} REQUIRED)
0032 find_package(KF5Package ${KF_DEP_VERSION} REQUIRED)
0033 find_package(KF5Notifications ${KF_DEP_VERSION} REQUIRED)
0034 
0035 
0036 if(NOT WIN32)
0037     find_package(KF5GlobalAccel ${KF_DEP_VERSION} REQUIRED)
0038 endif()
0039 #########################################################################
0040 
0041 #add_definitions(-Wno-deprecated)
0042 
0043 # Includes
0044 
0045 include(ECMGenerateExportHeader)
0046 include(ECMSetupVersion)
0047 include(ECMGenerateHeaders)
0048 include(CMakePackageConfigHelpers)
0049 include(ECMAddQch)
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_EXAMPLES "Build and install examples." OFF)
0054 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0055 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0056 
0057 
0058 # ECM setup
0059 ecm_setup_version(
0060   PROJECT
0061   VARIABLE_PREFIX KDECLARATIVE
0062   VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdeclarative_version.h"
0063   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5DeclarativeConfigVersion.cmake"
0064   SOVERSION 5)
0065 
0066 # Subdirectories
0067 add_definitions(-DTRANSLATION_DOMAIN=\"kdeclarative5\")
0068 ecm_set_disabled_deprecation_versions(
0069     QT 5.15.2
0070     KF 5.95
0071 )
0072 
0073 ki18n_install(po)
0074 
0075 if (QT_MAJOR_VERSION STREQUAL "5")
0076     find_package(epoxy)
0077     set_package_properties(epoxy PROPERTIES DESCRIPTION "libepoxy"
0078         URL "https://github.com/anholt/libepoxy"
0079         TYPE OPTIONAL
0080         PURPOSE "OpenGL dispatch library"
0081     )
0082 endif()
0083 set(HAVE_EPOXY 0)
0084 if(epoxy_FOUND)
0085     set(HAVE_EPOXY 1)
0086 endif()
0087 add_subdirectory(src)
0088 if (BUILD_TESTING)
0089     add_subdirectory(autotests)
0090     add_subdirectory(tests)
0091 endif()
0092 
0093 # Create a Config.cmake and a ConfigVersion.cmake file and install them
0094 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Declarative")
0095 
0096 if (BUILD_QCH)
0097     ecm_install_qch_export(
0098         TARGETS KF5Declarative_QCH
0099         FILE KF5DeclarativeQchTargets.cmake
0100         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0101         COMPONENT Devel
0102     )
0103     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5DeclarativeQchTargets.cmake\")")
0104 endif()
0105 
0106 configure_package_config_file(
0107   "${CMAKE_CURRENT_SOURCE_DIR}/KF5DeclarativeConfig.cmake.in"
0108   "${CMAKE_CURRENT_BINARY_DIR}/KF5DeclarativeConfig.cmake"
0109   INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0110 )
0111 
0112 install(FILES
0113   "${CMAKE_CURRENT_BINARY_DIR}/KF5DeclarativeConfig.cmake"
0114   "${CMAKE_CURRENT_BINARY_DIR}/KF5DeclarativeConfigVersion.cmake"
0115   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0116   COMPONENT Devel
0117 )
0118 
0119 install(EXPORT
0120   KF5DeclarativeTargets
0121   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0122   FILE KF5DeclarativeTargets.cmake
0123   NAMESPACE KF5::
0124   COMPONENT Devel
0125 )
0126 
0127 install(FILES
0128   "${CMAKE_CURRENT_BINARY_DIR}/kdeclarative_version.h"
0129   DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF}/KDeclarative"
0130   COMPONENT Devel
0131 )
0132 
0133 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0134 
0135 if(KF5Config_FOUND AND KF5I18n_FOUND AND KF5IconThemes_FOUND AND KF5KIO_FOUND)
0136   message("Dependencies for libkdeclarative found: it will be built")
0137 else()
0138   message("In order to build libkdeclarative you need KF5Config, KF5I18n, KF5IconThemes and KF5KIO")
0139 endif()
0140 
0141 if(KF5I18n_FOUND AND KF5WidgetsAddons_FOUND AND KF5WindowSystem_FOUND AND KF5KIO_FOUND AND KF5GuiAddons_FOUND)
0142   message("Dependencies for KQuickControls found: it will be built")
0143 else()
0144   message("In order to build KQuickControls you need KF5I18n, KF5WidgetsAddons, KF5WindowSystem, KF5GlobalAccel, KF5KIO and KF5GuiAddons")
0145 endif()
0146 
0147 if(KF5CoreAddons_FOUND)
0148   message("Dependencies for KCoreAddons QML bindings found; it will be built")
0149 else()
0150   message("In order to build KCoreAddons QML bindings you need KCoreAddons")
0151 endif()
0152 
0153 
0154 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)