Warning, /frameworks/kcodecs/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 project(KCodecs VERSION ${KF_VERSION})
0005 
0006 include(FeatureSummary)
0007 find_package(ECM 5.115.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 
0012 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0013 
0014 include(KDEInstallDirs)
0015 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0016 include(KDECMakeSettings)
0017 include(KDEGitCommitHooks)
0018 include(ECMQtDeclareLoggingCategory)
0019 include(ECMDeprecationSettings)
0020 
0021 set(REQUIRED_QT_VERSION 5.15.2)
0022 find_package(Qt${QT_MAJOR_VERSION}Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
0023 
0024 if (QT_MAJOR_VERSION STREQUAL "6")
0025     find_package(Qt6Core5Compat ${REQUIRED_QT_VERSION} REQUIRED CONFIG) # QTextCodec
0026 endif()
0027 
0028 find_package(Gperf REQUIRED)
0029 
0030 include(ECMGenerateExportHeader)
0031 include(CMakePackageConfigHelpers)
0032 include(ECMSetupVersion)
0033 include(ECMGenerateHeaders)
0034 
0035 include(ECMPoQmTools)
0036 include(ECMAddQch)
0037 
0038 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0039 
0040 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0041 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0042 
0043 ecm_setup_version(PROJECT VARIABLE_PREFIX KCODECS
0044                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcodecs_version.h"
0045                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CodecsConfigVersion.cmake"
0046                         SOVERSION 5)
0047 
0048 ecm_install_po_files_as_qm(poqm)
0049 
0050 ecm_set_disabled_deprecation_versions(
0051     QT 5.15.2
0052 )
0053 
0054 add_subdirectory(src)
0055 
0056 if (BUILD_TESTING)
0057     add_subdirectory(autotests)
0058 endif()
0059 
0060 # create a Config.cmake and a ConfigVersion.cmake file and install them
0061 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Codecs")
0062 
0063 if (BUILD_QCH)
0064     ecm_install_qch_export(
0065         TARGETS KF5Codecs_QCH
0066         FILE KF5CodecsQchTargets.cmake
0067         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0068         COMPONENT Devel
0069     )
0070     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5CodecsQchTargets.cmake\")")
0071 endif()
0072 
0073 configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KF5CodecsConfig.cmake.in"
0074                               "${CMAKE_CURRENT_BINARY_DIR}/KF5CodecsConfig.cmake"
0075                               INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0076                               )
0077 
0078 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KF5CodecsConfig.cmake"
0079                "${CMAKE_CURRENT_BINARY_DIR}/KF5CodecsConfigVersion.cmake"
0080         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0081         COMPONENT Devel )
0082 
0083 install(EXPORT KF5CodecsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5CodecsTargets.cmake NAMESPACE KF5:: )
0084 
0085 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kcodecs_version.h
0086         DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KCodecs COMPONENT Devel)
0087 
0088 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0089 
0090 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)