Warning, /frameworks/kconfig/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(KConfig VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.249.0  NO_MODULE)
0008 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0009 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0010 
0011 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0012 
0013 include(KDEInstallDirs)
0014 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0015 include(KDECMakeSettings)
0016 include(KDEGitCommitHooks)
0017 
0018 include(ECMGenerateExportHeader)
0019 include(ECMSetupVersion)
0020 include(ECMGenerateHeaders)
0021 include(ECMMarkNonGuiExecutable)
0022 include(ECMPoQmTools)
0023 include(ECMAddQch)
0024 include(ECMQtDeclareLoggingCategory)
0025 include(ECMDeprecationSettings)
0026 include(ECMQmlModule)
0027 
0028 set(REQUIRED_QT_VERSION 6.5.0)
0029 
0030 find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Xml)
0031 option(KCONFIG_USE_GUI "Build components using Qt6Gui" ON)
0032 if(KCONFIG_USE_GUI)
0033     find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui)
0034 endif()
0035 
0036 option(KCONFIG_USE_QML "Build components using Qt6Qml" ON)
0037 
0038 if(KCONFIG_USE_QML)
0039     find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Qml)
0040 endif()
0041 
0042 if(NOT ANDROID)
0043     set(default_kconfig_use_dbus ON)
0044     if(WIN32)
0045         set(default_kconfig_use_dbus OFF)
0046     endif()
0047     option(KCONFIG_USE_DBUS "Build components using Qt6DBus" ${default_kconfig_use_dbus})
0048     if(KCONFIG_USE_DBUS)
0049         find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus)
0050     endif()
0051 else()
0052     set(KCONFIG_USE_DBUS Off)
0053 endif()
0054 
0055 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0056 
0057 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0058 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0059 
0060 set(kconfig_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/core/kconfig_version.h")
0061 ecm_setup_version(PROJECT VARIABLE_PREFIX KCONFIG
0062                         VERSION_HEADER "${kconfig_version_header}"
0063                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfigVersion.cmake"
0064                         SOVERSION 6)
0065 
0066 ecm_set_disabled_deprecation_versions(
0067     QT 6.5
0068 )
0069 
0070 add_subdirectory(src)
0071 if(BUILD_TESTING)
0072     add_subdirectory(autotests)
0073 endif()
0074 
0075 include (ECMPoQmTools)
0076 ecm_install_po_files_as_qm(poqm)
0077 
0078 
0079 # create a Config.cmake and a ConfigVersion.cmake file and install them
0080 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Config")
0081 
0082 if(BUILD_QCH)
0083     ecm_install_qch_export(
0084         TARGETS KF6Config_QCH
0085         FILE KF6ConfigQchTargets.cmake
0086         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0087         COMPONENT Devel
0088     )
0089     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF6ConfigQchTargets.cmake\")")
0090 endif()
0091 
0092 include(CMakePackageConfigHelpers)
0093 
0094 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF6ConfigConfig.cmake.in"
0095                               "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfig.cmake"
0096                               INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0097                               )
0098 
0099 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfig.cmake"
0100                "${CMAKE_CURRENT_BINARY_DIR}/KF6ConfigConfigVersion.cmake"
0101                "${CMAKE_CURRENT_SOURCE_DIR}/KF6ConfigMacros.cmake"
0102         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0103         COMPONENT Devel )
0104 
0105 
0106 install(EXPORT KF6ConfigTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0107         FILE KF6ConfigTargets.cmake NAMESPACE KF6:: COMPONENT Devel)
0108 
0109 
0110 install(EXPORT KF6ConfigCompilerTargets DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Config"
0111         FILE KF6ConfigCompilerTargets.cmake NAMESPACE KF6:: COMPONENT Devel)
0112 
0113 install(FILES ${kconfig_version_header}
0114         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KConfig COMPONENT Devel)
0115 
0116 
0117 include(ECMFeatureSummary)
0118 ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0119 
0120 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)