CMakeLists.txt 5.29 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
project(kalarm)

Laurent Montel's avatar
Laurent Montel committed
3
if(${CMAKE_SOURCE_DIR} STREQUAL ${kalarm_SOURCE_DIR})
Laurent Montel's avatar
Laurent Montel committed
4
    cmake_minimum_required(VERSION 3.1)
Laurent Montel's avatar
Laurent Montel committed
5
    set(KF5_VERSION "5.23.0")
Laurent Montel's avatar
Laurent Montel committed
6
    find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
7
    set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
    include(ECMInstallIcons)

    include(ECMOptionalAddSubdirectory)
    include(ECMSetupVersion)
    include(ECMAddTests)
    include(ECMMarkNonGuiExecutable)
    include(GenerateExportHeader)
    include(ECMGenerateHeaders)
    include(CMakePackageConfigHelpers)
    include(FeatureSummary)
    include(CheckFunctionExists)
    include(ECMGeneratePriFile)

    include(KDEInstallDirs)
    include(KDECMakeSettings)
    include(KDECompilerSettings NO_POLICY_SCOPE)
    include(ECMAddAppIcon)
    include(ECMQtDeclareLoggingCategory)

Laurent Montel's avatar
Laurent Montel committed
27
    # Do NOT add quote
Laurent Montel's avatar
5.3.40    
Laurent Montel committed
28
    set(KDEPIM_DEV_VERSION pre)
Laurent Montel's avatar
Laurent Montel committed
29
30
31
32
33

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


Laurent Montel's avatar
5.3.40    
Laurent Montel committed
36
    set(KDEPIM_VERSION_NUMBER "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
37
38
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")

Laurent Montel's avatar
Laurent Montel committed
39
40
41
42
    set(AKONADI_MIMELIB_VERSION "5.3.40")
    set(AKONADI_CONTACT_VERSION "5.3.40")
    set(KHOLIDAYS_LIB_VERSION "5.3.40")
    set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
43
    set(KPIMTEXTEDIT_LIB_VERSION "5.3.41")
44
    set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
45
46
47
    set(AKONADI_VERSION "5.3.40")
    set(KMIME_LIB_VERSION "5.3.40")
    set(AKONADIKALARM_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
48
    set(PIMCOMMON_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
49

Laurent Montel's avatar
Laurent Montel committed
50
51
52
53
    set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
    set(KDEPIM_LIB_SOVERSION "5")

    set(QT_REQUIRED_VERSION "5.6.0")
54
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Network Widgets)
Laurent Montel's avatar
Laurent Montel committed
55
    find_package(Qt5X11Extras NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
56
    set(MAILCOMMON_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
57
58
59
60
    set(LIBKDEPIM_LIB_VERSION_LIB "5.3.40")
    set(KCALENDARCORE_LIB_VERSION "5.3.40")
    set(CALENDARUTILS_LIB_VERSION "5.3.40")
    set(KDEPIM_APPS_LIB_VERSION_LIB "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
61

Laurent Montel's avatar
Laurent Montel committed
62
    # Find KF5 package
63
64
65
66
67
    find_package(KF5Auth ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Completion ${KF5_VERSION} REQUIRED)
    find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5ConfigWidgets ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
68
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
69
    find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
70
71
72
73
    find_package(KF5GuiAddons ${KF5_VERSION} REQUIRED)
    find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5IconThemes ${KF5_VERSION} REQUIRED)
    find_package(KF5JobWidgets ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
74
    find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
75
76
77
78
79
80
81
    find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Notifications ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82
83
84
85
    find_package(Phonon4Qt5 CONFIG REQUIRED)

    # Find KdepimLibs Package
    find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
86
87
    find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
    find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
88
89
90
    find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
91
    find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
92
93
94
95
    find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
97
98
99
    find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
100
101


Laurent Montel's avatar
Laurent Montel committed
102
103
104
    if (NOT APPLE)
        find_package(X11)
    endif()
105
    add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Laurent Montel's avatar
Laurent Montel committed
106
endif()
Laurent Montel's avatar
Laurent Montel committed
107
add_definitions(-DQT_USE_QSTRINGBUILDER)
Laurent Montel's avatar
Laurent Montel committed
108
109
110
set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
Laurent Montel's avatar
Laurent Montel committed
111
112
set(KDEPIM_HAVE_X11 ${X11_FOUND})
configure_file(src/config-kalarm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kalarm.h )
Laurent Montel's avatar
Laurent Montel committed
113

Laurent Montel's avatar
Laurent Montel committed
114
include_directories(${kalarm_SOURCE_DIR} ${kalarm_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
115

Laurent Montel's avatar
Laurent Montel committed
116
117
118
119
120
add_definitions(-DQT_STRICT_ITERATORS)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_MESSAGELOGCONTEXT)

Laurent Montel's avatar
Laurent Montel committed
121
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
122

Laurent Montel's avatar
Laurent Montel committed
123
124
install( FILES kalarm.categories DESTINATION ${KDE_INSTALL_CONFDIR} )

Laurent Montel's avatar
Laurent Montel committed
125
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
Laurent Montel's avatar
Laurent Montel committed
126
    feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Laurent Montel's avatar
Laurent Montel committed
127
endif()