CMakeLists.txt 5.06 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
project(accountwizard)

if(${CMAKE_SOURCE_DIR} STREQUAL ${accountwizard_SOURCE_DIR})
Laurent Montel's avatar
Laurent Montel committed
4
    cmake_minimum_required(VERSION 3.1)
Laurent Montel's avatar
Laurent Montel committed
5
6
7
8

    set(LIBRARY_NAMELINK LIBRARY NAMELINK_SKIP)

    # we need some parts of the ECM CMake helpers
9
    set(KF5_VERSION "5.25.0")
Laurent Montel's avatar
Laurent Montel committed
10
    find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
11
    set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Laurent Montel's avatar
Laurent Montel committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    include(ECMOptionalAddSubdirectory)
    include(ECMInstallIcons)
    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
30
    # Do NOT add quote
Laurent Montel's avatar
5.3.40    
Laurent Montel committed
31
    set(KDEPIM_DEV_VERSION pre)
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
36
37

    # add an extra space
    if(DEFINED KDEPIM_DEV_VERSION)
        set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
    endif()

Laurent Montel's avatar
Laurent Montel committed
38

Laurent Montel's avatar
Laurent Montel committed
39
    set(KDEPIM_VERSION_NUMBER "5.3.42")
Laurent Montel's avatar
Laurent Montel committed
40
41
    set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")

Laurent Montel's avatar
Laurent Montel committed
42
    set(AKONADI_MIMELIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
43
    set(AKONADI_CONTACT_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
44
    set(KCONTACTS_LIB_VERSION "5.3.40")
45
    set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
46
47
    set(KLDAP_LIB_VERSION "5.3.40")
    set(KMAILTRANSPORT_LIB_VERSION "5.3.40")
Laurent Montel's avatar
Laurent Montel committed
48
    set(KPIMTEXTEDIT_LIB_VERSION "5.3.43")
49
    set(AKONADI_VERSION "5.3.43")
Laurent Montel's avatar
Laurent Montel committed
50
51
52
53
54
55

    set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
    set(KDEPIM_LIB_SOVERSION "5")

    set(QT_REQUIRED_VERSION "5.6.0")
    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)
Laurent Montel's avatar
Laurent Montel committed
56
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Xml DBus Test)
Laurent Montel's avatar
Laurent Montel committed
57
    set(MAILCOMMON_LIB_VERSION_LIB "5.3.42")
58
    set(MESSAGELIB_LIB_VERSION_LIB "5.3.47")
Laurent Montel's avatar
Laurent Montel committed
59
    set(PIMCOMMON_LIB_VERSION_LIB "5.3.41")
Laurent Montel's avatar
Laurent Montel committed
60
    set(LIBKDEPIM_LIB_VERSION_LIB "5.3.42")
61
    set(LIBKLEO_LIB_VERSION_LIB "5.3.44")
Laurent Montel's avatar
Laurent Montel committed
62
63
64
65
66
67
68
69

    # Find KF5 package
    find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5NotifyConfig ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
70
    find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
71
72
    find_package(KF5TextEditor ${KF5_VERSION} CONFIG REQUIRED)
    find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
73
    find_package(KF5Crash ${KF5_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
74
75
76
77
    # Find KdepimLibs Package
    find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
    find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
78
    find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
79
80
    find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
    find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
81
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
82
83
84
85
    find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
    find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
86
    find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
87
    find_package(MailTransportDBusService CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
88
89


Laurent Montel's avatar
Laurent Montel committed
90
91
92
    include_directories(${accountwizard_SOURCE_DIR} ${accountwizard_BINARY_DIR})

endif()
Laurent Montel's avatar
Laurent Montel committed
93
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Laurent Montel's avatar
Laurent Montel committed
94
add_definitions(-DQT_USE_QSTRINGBUILDER)
Laurent Montel's avatar
Laurent Montel committed
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

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

find_package(KF5Kross ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)

set( SHARED_MIME_INFO_MINIMUM_VERSION "0.40" )
find_package( SharedMimeInfo REQUIRED )

add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )

# 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
122
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
123
install( FILES accountwizard.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
124
125
126
127

if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
    feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()