CMakeLists.txt 4.92 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
set(PIM_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
2
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
3
project(kmail-account-wizard VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4

Laurent Montel's avatar
Laurent Montel committed
5 6 7

set(LIBRARY_NAMELINK LIBRARY NAMELINK_SKIP)

8
set(KF5_MIN_VERSION "5.78.0")
Laurent Montel's avatar
Laurent Montel committed
9

10
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
12

Laurent Montel's avatar
Laurent Montel committed
13 14 15
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
16

Laurent Montel's avatar
Laurent Montel committed
17 18
include(GenerateExportHeader)
include(ECMGenerateHeaders)
19

Laurent Montel's avatar
Laurent Montel committed
20 21 22 23 24 25
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

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

Laurent Montel's avatar
Laurent Montel committed
30
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
31 32
set(KDEPIM_DEV_VERSION alpha)
set(RELEASE_SERVICE_VERSION "21.03.80")
Laurent Montel's avatar
Laurent Montel committed
33 34 35 36

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

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

41 42
set(AKONADI_MIMELIB_VERSION "5.16.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
43
set(KLDAP_LIB_VERSION "5.16.41")
44 45 46 47
set(KMAILTRANSPORT_LIB_VERSION "5.16.40")
set(AKONADI_VERSION "5.16.40")
set(KIMAP_LIB_VERSION "5.16.40")
set(AKONADI_MIMELIB_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
48

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

52
set(QT_REQUIRED_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
53
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Xml DBus Test)
54 55 56
set(PIMCOMMON_LIB_VERSION "5.16.40")
set(LIBKDEPIM_LIB_VERSION "5.16.40")
set(LIBKLEO_LIB_VERSION "5.16.40")
Laurent Montel's avatar
Laurent Montel committed
57 58

# Find KF5 package
59 60 61 62 63 64 65 66 67 68 69
find_package(KF5Wallet ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5TextEditor ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
70

Laurent Montel's avatar
Laurent Montel committed
71 72 73
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
74
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
75 76 77
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
78
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
79
find_package(MailTransportDBusService CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
80
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
81 82 83 84


include_directories(${kmail-account-wizard_SOURCE_DIR} ${kmail-account-wizard_BINARY_DIR})

Laurent Montel's avatar
Laurent Montel committed
85 86 87 88

# Qt5 package
find_package(Qt5UiTools ${QT_REQUIRED_VERSION} CONFIG REQUIRED)

89 90
find_package(KF5Kross ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
91

92 93 94 95 96 97 98 99
#it will replace kwallet support
find_package(Qt5Keychain CONFIG)
set_package_properties(Qt5Keychain PROPERTIES
                                   DESCRIPTION "Provides support for secure credentials storage"
                                   URL "https://github.com/frankosterfeld/qtkeychain"
                                   TYPE OPTIONAL)


Laurent Montel's avatar
Laurent Montel committed
100
set( SharedMimeInfo_MINIMUM_VERSION "1.3" )
Laurent Montel's avatar
Laurent Montel committed
101
find_package(SharedMimeInfo ${SharedMimeInfo_MINIMUM_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
102

103
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
104
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00)
105 106
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
add_definitions(-DQT_NO_EMIT)
Laurent Montel's avatar
Laurent Montel committed
107
add_definitions(-DQT_NO_FOREACH)
108 109
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
110

Laurent Montel's avatar
Laurent Montel committed
111 112 113 114 115 116 117 118 119 120
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)
    endif()
endif()
Laurent Montel's avatar
Laurent Montel committed
121 122 123 124 125 126 127 128 129 130 131 132 133 134
# allow to disable GHNS support on resource-constrained systems
option( ACCOUNTWIZARD_NO_GHNS "Disable GHNS support in the account wizard" FALSE )

option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)

# config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
configure_file(src/config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config-enterprise.h )

if ( ACCOUNTWIZARD_NO_GHNS )
    add_definitions( -DACCOUNTWIZARD_NO_GHNS )
endif ()



Laurent Montel's avatar
Laurent Montel committed
135
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
136

Laurent Montel's avatar
Laurent Montel committed
137

Laurent Montel's avatar
Laurent Montel committed
138
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)