CMakeLists.txt 3.2 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
set(PIM_VERSION "5.17.0")
Laurent Montel's avatar
Laurent Montel committed
2
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
3
project(kontact VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "21.04.0")
5
set(KF5_MIN_VERSION "5.79.0")
6
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
7

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)
19
include(KDEGitCommitHooks)
Laurent Montel's avatar
Laurent Montel committed
20 21 22 23 24
include(CheckFunctionExists)
include(ECMGeneratePriFile)

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

Laurent Montel's avatar
Laurent Montel committed
29 30

# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
31
set(KDEPIM_DEV_VERSION )
Laurent Montel's avatar
Laurent Montel committed
32 33 34 35

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

38
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Laurent Montel committed
39

Laurent Montel's avatar
Laurent Montel committed
40 41 42 43
set(KPIMTEXTEDIT_LIB_VERSION "5.17.0")
set(AKONADI_VERSION "5.17.0")
set(KONTACTINTERFACE_LIB_VERSION "5.17.0")
set(PIMCOMMON_LIB_VERSION "5.17.0")
Laurent Montel's avatar
Laurent Montel committed
44

45
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
46 47 48
set(KDEPIM_LIB_SOVERSION "5")


49
set(QT_REQUIRED_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
50
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Widgets WebEngine WebEngineWidgets)
Laurent Montel's avatar
Laurent Montel committed
51 52
set(LIBKDEPIM_LIB_VERSION "5.17.0")
set(LIBGRANTLEETHEME_LIB_VERSION "5.17.0")
Laurent Montel's avatar
Laurent Montel committed
53
# Find KF5 package
54 55 56 57 58 59
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
60 61 62 63 64 65


# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
66 67 68
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
69 70 71


include_directories(${kontact_SOURCE_DIR} ${kontact_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
72
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
73
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055000)
Laurent Montel's avatar
Laurent Montel committed
74
set(CMAKE_CXX_STANDARD 14)
75
set(CMAKE_CXX_STANDARD_REQUIRED ON)
76

Laurent Montel's avatar
Laurent Montel committed
77
add_definitions(-DTRANSLATION_DOMAIN=\"kontact\")
Laurent Montel's avatar
Laurent Montel committed
78
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
79

Laurent Montel's avatar
Laurent Montel committed
80 81
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
82 83 84
    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()
Laurent Montel's avatar
Laurent Montel committed
85
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
86 87
    endif()
endif()
Allen Winter's avatar
Allen Winter committed
88
add_subdirectory(src)
89
add_subdirectory(kconf_update)
Laurent Montel's avatar
Laurent Montel committed
90

91
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
92 93 94 95
        EXPORT KONTACT
        FILE kontact.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
96
add_subdirectory(doc)
97
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
98 99
ki18n_install(po)
kdoctools_install(po)
Laurent Montel's avatar
Laurent Montel committed
100
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)