Warning, /frameworks/kitemmodels/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 project(KItemModels VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.249.0 NO_MODULE)
0008 set_package_properties(ECM PROPERTIES
0009     TYPE REQUIRED
0010     DESCRIPTION "Extra CMake Modules."
0011     URL "https://commits.kde.org/extra-cmake-modules"
0012 )
0013 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0014 
0015 
0016 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0017 
0018 include(KDEInstallDirs)
0019 include(KDECMakeSettings)
0020 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0021 
0022 include(KDEGitCommitHooks)
0023 include(ECMQtDeclareLoggingCategory)
0024 include(ECMSetupVersion)
0025 include(ECMGenerateHeaders)
0026 include(ECMGenerateExportHeader)
0027 include(ECMDeprecationSettings)
0028 include(ECMAddQch)
0029 include(CMakePackageConfigHelpers)
0030 include(ECMQmlModule)
0031 
0032 set(REQUIRED_QT_VERSION 6.5.0)
0033 find_package(Qt6Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
0034 find_package(Qt6Qml ${REQUIRED_QT_VERSION} NO_MODULE)
0035 
0036 set_package_properties(Qt6Qml PROPERTIES
0037     TYPE OPTIONAL
0038     PURPOSE "Build QML import for KItemModels and proxymodeltestapp"
0039 )
0040 
0041 
0042 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0043 
0044 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0045 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0046 
0047 set(kitemmodels_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/core/kitemmodels_version.h")
0048 ecm_setup_version(PROJECT VARIABLE_PREFIX KITEMMODELS
0049     VERSION_HEADER "${kitemmodels_version_header}"
0050     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6ItemModelsConfigVersion.cmake"
0051     SOVERSION 6
0052 )
0053 
0054 ecm_set_disabled_deprecation_versions(
0055     QT 6.5
0056 )
0057 
0058 add_subdirectory(src)
0059 if (BUILD_TESTING)
0060     find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test Widgets)
0061     find_package(Qt6QuickWidgets ${REQUIRED_QT_VERSION} NO_MODULE)
0062     set_package_properties(Qt6QuickWidgets PROPERTIES
0063         TYPE OPTIONAL
0064         PURPOSE "Build proxymodeltestapp QML selection and QML treeview examples"
0065     )
0066     add_subdirectory(autotests)
0067     add_subdirectory(tests)
0068 endif()
0069 
0070 
0071 # create a Config.cmake and a ConfigVersion.cmake file and install them
0072 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6ItemModels")
0073 
0074 if (BUILD_QCH)
0075     ecm_install_qch_export(
0076         TARGETS KF6ItemModels_QCH
0077         FILE KF6ItemModelsQCHTargets.cmake
0078         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0079     )
0080     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6ItemModelsQCHTargets.cmake\")")
0081 endif()
0082 
0083 configure_package_config_file(
0084     "${CMAKE_CURRENT_SOURCE_DIR}/KF6ItemModelsConfig.cmake.in"
0085     "${CMAKE_CURRENT_BINARY_DIR}/KF6ItemModelsConfig.cmake"
0086     INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0087 )
0088 
0089 install(FILES
0090     "${CMAKE_CURRENT_BINARY_DIR}/KF6ItemModelsConfig.cmake"
0091     "${CMAKE_CURRENT_BINARY_DIR}/KF6ItemModelsConfigVersion.cmake"
0092     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0093     COMPONENT Devel
0094 )
0095 
0096 install(EXPORT KF6ItemModelsTargets
0097     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0098     FILE KF6ItemModelsTargets.cmake
0099     NAMESPACE KF6::
0100 )
0101 
0102 install(FILES
0103     ${kitemmodels_version_header}
0104     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KItemModels
0105     COMPONENT Devel
0106 )
0107 
0108 include(ECMFeatureSummary)
0109 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0110 
0111 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)