Warning, /frameworks/kcalendarcore/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 set(KF_VERSION "5.98.0") # handled by release scripts
0003 
0004 project(KCalendarCore VERSION ${KF_VERSION})
0005 
0006 # ECM setup
0007 include(FeatureSummary)
0008 find_package(ECM 5.97.0  NO_MODULE)
0009 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
0010 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
0011 
0012 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0013 
0014 set(REQUIRED_QT_VERSION 5.15.2)
0015 
0016 include(KDEInstallDirs)
0017 include(KDECMakeSettings)
0018 include(KDEGitCommitHooks)
0019 include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
0020 
0021 include(ECMGenerateExportHeader)
0022 include(ECMGenerateHeaders)
0023 include(ECMGeneratePriFile)
0024 include(ECMGeneratePkgConfigFile)
0025 include(ECMDeprecationSettings)
0026 
0027 include(ECMSetupVersion)
0028 include(ECMQtDeclareLoggingCategory)
0029 include(ECMAddQch)
0030 
0031 set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
0032 
0033 option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
0034 add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
0035 
0036 # TODO: remove for KF6
0037 option(KCALENDARCORE_NO_DEPRECATED_NAMESPACE "Disable deprecated KCalCore namespace" OFF)
0038 
0039 if(POLICY CMP0053)
0040   cmake_policy(SET CMP0053 NEW)
0041 endif()
0042 
0043 set(KCALENDARCORE_LIB_VERSION ${KF_VERSION})
0044 ecm_setup_version(PROJECT VARIABLE_PREFIX KCALENDARCORE
0045   VERSION_HEADER "${KCalendarCore_BINARY_DIR}/kcalendarcore_version.h"
0046   PACKAGE_VERSION_FILE "${KCalendarCore_BINARY_DIR}/KF5CalendarCoreConfigVersion.cmake"
0047   SOVERSION 5
0048 )
0049 
0050 ########### Find packages ###########
0051 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Gui)
0052 
0053 set(LibIcal_MIN_VERSION "3.0")
0054 # TODO remove our FindLibIcal.cmake in favor of upstream LibIcalConfig.cmake once the following issues are resolved:
0055 # https://github.com/libical/libical/pull/510
0056 # https://bugs.launchpad.net/ubuntu/+source/libical3/+bug/1946963
0057 # https://bugs.launchpad.net/ubuntu/+source/libical/+bug/1920587
0058 find_package(LibIcal ${LibIcal_MIN_VERSION})
0059 set_package_properties(LibIcal PROPERTIES TYPE REQUIRED)
0060 
0061 ########### CMake Config Files ###########
0062 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarCore")
0063 
0064 if (BUILD_QCH)
0065     set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5CalendarCoreQchTargets.cmake\")")
0066 endif()
0067 
0068 configure_package_config_file(
0069   "${CMAKE_CURRENT_SOURCE_DIR}/KF5CalendarCoreConfig.cmake.in"
0070   "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfig.cmake"
0071   INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
0072 )
0073 
0074 ecm_set_disabled_deprecation_versions(
0075     QT 5.15.2
0076 )
0077 
0078 ########### Targets ###########
0079 add_subdirectory(src)
0080 
0081 if(BUILD_TESTING)
0082   find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test)
0083   add_subdirectory(autotests)
0084 endif()
0085 
0086 ########### Install Files ###########
0087 install(FILES
0088   "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfig.cmake"
0089   "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfigVersion.cmake"
0090   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0091   COMPONENT Devel
0092 )
0093 
0094 install(EXPORT KF5CalendarCoreTargets
0095   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0096   FILE KF5CalendarCoreTargets.cmake
0097   NAMESPACE KF5::
0098 )
0099 
0100 if (BUILD_QCH)
0101     ecm_install_qch_export(
0102         TARGETS KF5CalendarCore_QCH
0103         FILE KF5CalendarCoreQchTargets.cmake
0104         DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0105         COMPONENT Devel
0106     )
0107 endif()
0108 
0109 install(FILES
0110   ${CMAKE_CURRENT_BINARY_DIR}/kcalendarcore_version.h
0111   DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KCalendarCore COMPONENT Devel
0112 )
0113 if (NOT KCALENDARCORE_NO_DEPRECATED_NAMESPACE)
0114   ecm_setup_version(PROJECT VARIABLE_PREFIX KCALCORE
0115     VERSION_HEADER "${KCalendarCore_BINARY_DIR}/kcalcore_version.h"
0116   )
0117   install(FILES
0118     ${CMAKE_CURRENT_BINARY_DIR}/kcalcore_version.h
0119     DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF} COMPONENT Devel
0120   )
0121 endif()
0122 
0123 if (NOT WIN32)
0124     ecm_generate_pkgconfig_file(BASE_NAME KF5CalendarCore
0125       INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KCalendarCore/
0126       DEPS "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Gui"
0127     INSTALL)
0128 endif()
0129 
0130 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0131 
0132 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)