CMakeLists.txt 4.39 KB
Newer Older
1
2
project(accountwizard)

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if(${CMAKE_SOURCE_DIR} STREQUAL ${accountwizard_SOURCE_DIR})
    cmake_minimum_required(VERSION 2.8.12)

    set(LIBRARY_NAMELINK LIBRARY NAMELINK_SKIP)

    # we need some parts of the ECM CMake helpers
    find_package(ECM 5.20.0 REQUIRED NO_MODULE)
    set(CMAKE_MODULE_PATH ${kdepim_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
    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)


    set(KDEPIM_VERSION_NUMBER "5.2.42")

    set(KMAILTRANSPORT_LIB_VERSION "5.2.40")
    find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)


    include_directories(${accountwizard_SOURCE_DIR} ${accountwizard_BINARY_DIR})

endif()

40
41
42
43
44
45
46
47
48
49
50
51
52
# 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
Laurent Montel's avatar
Laurent Montel committed
53
option( ACCOUNTWIZARD_NO_GHNS "Disable GHNS support in the account wizard" FALSE )
54
55
56
57
58
59
60

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(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )

if ( ACCOUNTWIZARD_NO_GHNS )
61
    add_definitions( -DACCOUNTWIZARD_NO_GHNS )
62
63
64
65
endif ()


set(accountwizard_srcs
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    dialog.cpp
    typepage.cpp
    loadpage.cpp
    global.cpp
    page.cpp
    dynamicpage.cpp
    setupmanager.cpp
    setuppage.cpp
    resource.cpp
    setupobject.cpp
    transport.cpp
    configfile.cpp
    ldap.cpp
    identity.cpp
    setupispdb.cpp
    setupautoconfigkolabmail.cpp
    setupautoconfigkolabldap.cpp
    setupautoconfigkolabfreebusy.cpp
    servertest.cpp
    personaldatapage.cpp
    ispdb/ispdb.cpp
    ispdb/autoconfigkolabmail.cpp
    ispdb/autoconfigkolabldap.cpp
    ispdb/autoconfigkolabfreebusy.cpp
    )
91
92

ki18n_wrap_ui(accountwizard_srcs
93
94
95
96
97
    ui/typepage.ui
    ui/loadpage.ui
    ui/setuppage.ui
    ui/personaldatapage.ui
    )
Laurent Montel's avatar
Laurent Montel committed
98
ecm_qt_declare_logging_category(accountwizard_srcs HEADER accountwizard_debug.h IDENTIFIER ACCOUNTWIZARD_LOG CATEGORY_NAME log_accountwizard)
99
100

set(accountwizard_libs
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    KF5::AkonadiCore
    KF5::MailTransport
    KF5::KCMUtils
    KF5::KrossCore
    KF5::KIOCore
    KF5::Mime
    KF5::IdentityManagement
    KF5::WidgetsAddons
    KF5::NewStuff
    Qt5::UiTools
    KF5::Libkdepim
    KF5::ItemViews
    KF5::I18n
    KF5::Ldap
    KF5::AkonadiWidgets
    )
117
118

if ( NOT ACCOUNTWIZARD_NO_GHNS )
119
120
121
    set(accountwizard_srcs ${accountwizard_srcs} providerpage.cpp)
    ki18n_wrap_ui(accountwizard_srcs ui/providerpage.ui)
    set(accountwizard_libs ${accountwizard_libs} KF5::NewStuff)
122
123
124
endif ()

add_executable(accountwizard ${accountwizard_srcs} main.cpp)
Laurent Montel's avatar
Laurent Montel committed
125
target_link_libraries(accountwizard ${accountwizard_libs} KF5::DBusAddons)
126
127
128
129
130

add_library(accountwizard_plugin MODULE ${accountwizard_srcs} inprocess-main.cpp)
target_link_libraries(accountwizard_plugin ${accountwizard_libs})

if ( NOT ACCOUNTWIZARD_NO_GHNS )
131
    install(FILES accountwizard.knsrc DESTINATION ${KDE_INSTALL_CONFDIR})
132
endif ()
133
134
135
136
137
install(TARGETS accountwizard ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS accountwizard_plugin DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(PROGRAMS org.kde.accountwizard.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES accountwizard-mime.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
138
139
140

add_subdirectory(wizards)
add_subdirectory(ispdb)
141
if (BUILD_TESTING)
142
    add_subdirectory(autotests)
143
endif()
Laurent Montel's avatar
Laurent Montel committed
144
145

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