CMakeLists.txt 2.67 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.14.40")
3
project(kdepim-apps-lib VERSION ${PIM_VERSION})
4

5
set(KF5_MIN_VERSION "5.70.0")
6

7
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
8 9
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
Laurent Montel's avatar
Laurent Montel committed
10 11 12 13
if (POLICY CMP0053)
    cmake_policy(SET CMP0053 NEW)
endif()

14 15 16 17
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

18 19 20
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
21

22 23 24 25
include(ECMSetupVersion)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
26

Laurent Montel's avatar
Laurent Montel committed
27

28

Laurent Montel's avatar
Laurent Montel committed
29
set(KDEPIM_APPS_LIB_VERSION ${PIM_VERSION})
30

31
set(QT_REQUIRED_VERSION "5.12.0")
32

33 34 35 36 37
set(AKONADI_VERSION "5.14.40")
set(GRANTLEETHEME_LIB_VERSION "5.14.40")
set(AKONADICONTACT_LIB_VERSION "5.14.40")
set(LIBKLEO_LIB_VERSION "5.14.40")
set(PIMCOMMON_LIB_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
38
set(GRANTLEE_LIB_VERSION "5.2")
39

Laurent Montel's avatar
Laurent Montel committed
40
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Gui)
41

42 43 44 45 46 47 48
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
49 50

find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
51
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
52
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
53
find_package(KF5ContactEditor ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
54 55
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
56
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
57

Laurent Montel's avatar
Laurent Montel committed
58
find_package(Grantlee5 ${GRANTLEE_LIB_VERSION} CONFIG REQUIRED)
59

60
find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
61

62
if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
63
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test)
Laurent Montel's avatar
Indent  
Laurent Montel committed
64
    add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
65
endif()
66
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
67
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
68
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
69 70
endif()

Laurent Montel's avatar
Laurent Montel committed
71
add_definitions(-DQT_NO_FOREACH)
72
add_definitions(-DQT_NO_KEYWORDS)
73

74
add_subdirectory(kaddressbookgrantlee)
75
add_subdirectory(kaddressbookimportexport)
76 77
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

78
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
79 80 81 82
        EXPORT KDEPIMAPPSLIB
        FILE kdepim-apps-lib.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )