CMakeLists.txt 3.04 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.16.40")
3
project(akonadi-calendar-tools VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4

5
set(KF5_MIN_VERSION "5.78.0")
Laurent Montel's avatar
Laurent Montel committed
6

7
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
8
9
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)

11

Laurent Montel's avatar
Laurent Montel committed
12
13
include(ECMSetupVersion)
include(ECMAddTests)
14

Laurent Montel's avatar
Laurent Montel committed
15
16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
17

Laurent Montel's avatar
Laurent Montel committed
18
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
19
20
21
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
   include(KDEGitCommitHooks)
endif()
Laurent Montel's avatar
Laurent Montel committed
22
23
24
25
26
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
27
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
28
29
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
30

Laurent Montel's avatar
Laurent Montel committed
31
32

# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
33
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
34
35
36
37

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
38
endif()
Laurent Montel's avatar
Laurent Montel committed
39

40
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
41
42


43
44
45
46
set(AKONADICALENDAR_LIB_VERSION "5.16.40")
set(AKONADI_VERSION "5.16.40")
set(CALENDARSUPPORT_LIB_VERSION "5.16.40")
set(KCALENDARCORE_LIB_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
47

48
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
49
50
set(KDEPIM_LIB_SOVERSION "5")

51
set(QT_REQUIRED_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
52
53
54
55
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets)


# Find KF5 package
56
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
57
find_package(KF5I18n ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
58
59
60
61
62
63

# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
65
66

include_directories(${akonadi-calendar-tools_SOURCE_DIR} ${akonadi-calendar-tools_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
67
68
69

configure_file(console-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/console-version.h @ONLY)

70

Laurent Montel's avatar
Laurent Montel committed
71
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
72
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00)
73
add_definitions(-DQT_NO_EMIT)
Laurent Montel's avatar
Laurent Montel committed
74
add_definitions(-DQT_NO_FOREACH)
75
76
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
78
79
80
81
82
83
84
85
86
87
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
        message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
    else()
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
        add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
    endif()
endif()
Laurent Montel's avatar
Laurent Montel committed
88

89
add_subdirectory(calendarjanitor)
90
add_subdirectory(konsolekalendar)
Laurent Montel's avatar
Laurent Montel committed
91

92
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
93
94
95
96
        EXPORT AKONADICALENDARTOOLS
        FILE console.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Split    
Laurent Montel committed
97

Laurent Montel's avatar
Laurent Montel committed
98
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
99
100
101
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
Laurent Montel's avatar
Laurent Montel committed
102
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)