Warning, /frameworks/kholidays/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.99.0")
0004 project(KHolidays VERSION ${KF_VERSION})
0005 
0006 find_package(ECM 5.99.0 REQUIRED NO_MODULE)
0007 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0008 set(CMAKE_AUTORCC ON)
0009 
0010 include(KDEInstallDirs)
0011 include(KDECMakeSettings)
0012 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0013 
0014 include(GenerateExportHeader)
0015 include(ECMGenerateHeaders)
0016 include(CMakePackageConfigHelpers)
0017 include(ECMSetupVersion)
0018 include(ECMPoQmTools)
0019 include(FeatureSummary)
0020 include(ECMCoverageOption)
0021 include(ECMQtDeclareLoggingCategory)
0022 include(ECMAddQch)
0023 include(ECMGeneratePriFile)
0024 include(KDEGitCommitHooks)
0025 include(ECMGenerateExportHeader)
0026 include(ECMDeprecationSettings)
0027 
0028 set(KHOLIDAYS_LIB_VERSION ${KF_VERSION})
0029 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0030 
0031 ecm_setup_version(PROJECT VARIABLE_PREFIX KHOLIDAYS
0032                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kholidays_version.h"
0033                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfigVersion.cmake"
0034                         SOVERSION 5
0035 )
0036 
0037 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0038 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0039 
0040 ########### Find packages ###########
0041 set(REQUIRED_QT_VERSION 5.15.2)
0042 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Qml)
0043 
0044 remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
0045 ecm_set_disabled_deprecation_versions(
0046     QT 5.15.2
0047 )
0048 
0049 ########### Targets ###########
0050 add_subdirectory(src)
0051 
0052 if(BUILD_TESTING)
0053   add_subdirectory(autotests)
0054 endif()
0055 
0056 ecm_install_po_files_as_qm(poqm)
0057 
0058 ########### CMake Config Files ###########
0059 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Holidays")
0060 
0061 if(BUILD_QCH)
0062   ecm_install_qch_export(
0063     TARGETS KF5Holidays_QCH
0064     FILE KF5HolidaysQchTargets.cmake
0065     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0066     COMPONENT Devel
0067   )
0068   set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5HolidaysQchTargets.cmake\")")
0069 endif()
0070 
0071 configure_package_config_file(
0072   "${CMAKE_CURRENT_SOURCE_DIR}/KF5HolidaysConfig.cmake.in"
0073   "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfig.cmake"
0074   INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0075 )
0076 
0077 install(FILES
0078   "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfig.cmake"
0079   "${CMAKE_CURRENT_BINARY_DIR}/KF5HolidaysConfigVersion.cmake"
0080   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0081   COMPONENT Devel
0082 )
0083 
0084 install(EXPORT KF5HolidaysTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5HolidaysTargets.cmake NAMESPACE KF5::)
0085 
0086 install(FILES
0087   ${CMAKE_CURRENT_BINARY_DIR}/kholidays_version.h
0088   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KHolidays COMPONENT Devel
0089 )
0090 
0091 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0092 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)