forked from KDE/kcalcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (64 loc) · 2.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
cmake_minimum_required(VERSION 2.8.12)
project(KCalCore)
# ECM setup
find_package(ECM 5.14.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${KCalCore_SOURCE_DIR}/cmake)
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
set(KF5_VERSION "5.14.0")
set(KCALENDARCORE_LIB_VERSION "4.82.0")
ecm_setup_version(${KCALENDARCORE_LIB_VERSION} VARIABLE_PREFIX KCALCORE
VERSION_HEADER "${KCalCore_BINARY_DIR}/kcalcore_version.h"
PACKAGE_VERSION_FILE "${KCalCore_BINARY_DIR}/KF5CalendarCoreConfigVersion.cmake"
SOVERSION 5
)
########### Find packages ###########
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
set(LibIcal_MIN_VERSION "0.42")
find_package(LibIcal ${LibIcal_MIN_VERSION})
set_package_properties(LibIcal PROPERTIES
DESCRIPTION "The libical library"
URL "http://sourceforge.net/projects/freeassociation"
TYPE REQUIRED
)
include(ConfigureChecks.cmake)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarCore")
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5CalendarCoreConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
remove_definitions(-DQT_NO_CAST_TO_ASCII)
########### Targets ###########
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
add_subdirectory(cmake)
########### Install Files ###########
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarCoreConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5CalendarCoreTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KF5CalendarCoreTargets.cmake
NAMESPACE KF5::
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kcalcore_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)