~ubuntu-branches/ubuntu/karmic/kdepim/karmic

1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
1
project(kdepim)
2
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
3
# where to look first for cmake modules. This line must be the first one or cmake will use the system's FindFoo.cmake
1.1.31 by Harald Sitter
Import upstream version 4.1.85
4
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
5
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
6
7
############### Build Options ###############
8
9
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)
10
option(KDEPIM_ONLY_KLEO "Only build Kleopatra. This option will disable KDEPIM_BUILD_EVERYTHING and KDEPIM_ENTERPRISE_BUILD." FALSE)
11
# if KDEPIM_ENTERPRISE_BUILD is defined, KDEPIM_ONLY_KLEO is disabled
12
if(KDEPIM_ENTERPRISE_BUILD)
13
  set(KDEPIM_ONLY_KLEO FALSE)
14
  set(KDEPIM_BUILD_EVERYTHING FALSE)
15
  message(STATUS "Enterprise build is enabled.")
16
else(KDEPIM_ENTERPRISE_BUILD)
17
  # if KDEPIM_ONLY_KLEO is defined, KDEPIM_BUILD_EVERYTHING is disabled.
18
  if(KDEPIM_ONLY_KLEO)
19
    set(KDEPIM_BUILD_EVERYTHING FALSE)
20
    set(KDEPIM_DEFINITIONS "-DHAVE_CONFIG_H=1")
21
    message(STATUS "Only libkleo and Kleopatra will be built.")
22
  endif(KDEPIM_ONLY_KLEO)
23
  # Default
24
    set(KDEPIM_BUILD_EVERYTHING TRUE)
25
    message(STATUS "Enterprise build is disabled.")
26
endif(KDEPIM_ENTERPRISE_BUILD)
27
28
# config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
29
configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
30
31
32
############### search packages used by KDE ###############
33
34
find_package(KDE4 REQUIRED)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
35
include(KDE4Defaults)
36
include(MacroLibrary)
37
include(CheckIncludeFiles)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
38
include(MacroBoolTo01)
1.1.37 by Alessandro Ghersi
Import upstream version 4.2.90
39
find_package(KdepimLibs 4.2.87 REQUIRED)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
40
41
42
############### search Boost ###############
43
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
44
find_package(Boost 1.33.1)
45
macro_log_feature(Boost_FOUND "Boost" "Boost C++ Libraries" "http://www.boost.org" TRUE "1.33.1" "Required by several critical KDEPIM apps.")
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
46
47
# Kleopatra needs to know if the topological.hpp header exists (part of Boost_graph).
48
find_path(Boost_TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
49
macro_log_feature(Boost_TOPOLOGICAL_SORT_DIR "The Boost Topological_sort header" "topological_sort.hpp (part of Boost_graph)" "http://www.boost.org/" FALSE "" "Necessary to build kleopatra")
50
51
52
############### Windows specific ###############
1.1.31 by Harald Sitter
Import upstream version 4.1.85
53
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
54
if(WIN32)
1.1.29 by Jonathan Riddell
Import upstream version 4.1.73
55
  # detect oxygen icon dir at configure time based on KDEDIRS - there may be different package installation locations
56
  execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path icon OUTPUT_VARIABLE _dir ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
57
  file(TO_CMAKE_PATH "${_dir}" __dir)
58
  find_path(KDE4_ICON_DIR oxygen PATHS
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
59
    ${__dir}
1.1.29 by Jonathan Riddell
Import upstream version 4.1.73
60
  )
61
  message(STATUS "using oxygen application icons from ${KDE4_ICON_DIR}")
62
else(WIN32)
63
    set (KDE4_ICON_DIR  ${CMAKE_INSTALL_PREFIX}/share/icons)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
64
endif(WIN32)
65
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
66
67
############### ONLY_KLEO ###############
68
69
# The KDEPIM_ONLY_KLEO option is true
70
if(KDEPIM_ONLY_KLEO)
71
  find_package(QGpgme)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
72
  macro_log_feature(QGPGME_FOUND "QGpgME" "The QGpgME library" "http://www.kde.org" TRUE "" "QGpgME is required to build Kleopatra.")
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
73
74
  add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${KDEPIM_DEFINITIONS})
1.1.37 by Alessandro Ghersi
Import upstream version 4.2.90
75
  include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${KDEPIMLIBS_INCLUDE_DIRS} ${QT_QTDBUS_INCLUDE_DIR})
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
76
  include(kleopatra/ConfigureChecks.cmake)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
77
78
  add_subdirectory(libkleo)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
79
  if (Boost_TOPOLOGICAL_SORT_DIR)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
80
    macro_optional_add_subdirectory(kleopatra)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
81
  endif (Boost_TOPOLOGICAL_SORT_DIR)
82
83
else(KDEPIM_ONLY_KLEO)
84
85
# Otherwise...
86
############### Find the stuff we need ###############
87
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
88
  find_package(Akonadi QUIET NO_MODULE)
89
  macro_log_feature(Akonadi_FOUND "Akonadi" "Akonadi server libraries (from kdesupport)" "http://pim.kde.org/akonadi" TRUE "" "Akonadi is required to build KDEPIM")
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
90
91
  find_package(ZLIB)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
92
  macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.zlib.net" TRUE "" "")
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
93
94
  find_package(Strigi)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
95
  macro_log_feature(STRIGI_FOUND "Strigi" "Index metadata of files" "http://strigi.sourceforge.net" TRUE "" "")
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
96
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
97
  find_package(QGpgme)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
98
  macro_log_feature(QGPGME_FOUND "QGpgME" "The QGpgME library" "http://www.kde.org" FALSE "" "QGpgME is required to build KMail, KOrganizer and Kleopatra")
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
99
100
  macro_optional_find_package(Soprano)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
101
  macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "http://soprano.sourceforge.net" FALSE "" "Soprano is needed for Nepomuk")
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
102
103
  macro_optional_find_package(Nepomuk)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
104
  macro_log_feature(Nepomuk_FOUND "Nepomuk" "The Nepomuk libraries" "http://www.kde.org" FALSE "" "Nepomuk extends the search and tagging functionalities in KMail and Akonadi")
105
1.1.37 by Alessandro Ghersi
Import upstream version 4.2.90
106
  find_package(LibKNotificationItem-1_New)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
107
  macro_log_feature(LIBKNOTIFICATIONITEM-1_FOUND "LibKNotificationItem-1" "An experimental library" "svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs/experimental" TRUE "" "LibKNotificationItem-1 is an unfinished library which is required by korgac and akonaditray.")
108
109
110
############### Needed commands before building anything ###############
111
112
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${KDEPIM_DEFINITIONS})
113
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDEPIMLIBS_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QT_QTDBUS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libkdepim)
114
115
116
############### Code used in several places ###############
117
# TODO Remove from the top CMakeLists.
118
119
# used in knotes, kontact/plugins/knotes, kresources/egroupware, kresources/kolab/knotes, kresources/scalix/knotes, wizard
120
set(libknotesresources_SRCS
121
  ${CMAKE_SOURCE_DIR}/knotes/resourcemanager.cpp
122
  ${CMAKE_SOURCE_DIR}/knotes/resourcenotes.cpp
123
  ${CMAKE_SOURCE_DIR}/knotes/resourcelocal.cpp
124
  ${CMAKE_SOURCE_DIR}/knotes/resourcelocalconfig.cpp
125
)
126
127
# used in knotes, kontact/plugins/knotes
128
set(libknoteseditor_SRCS
129
  ${CMAKE_SOURCE_DIR}/knotes/knoteedit.cpp
130
)
131
132
# used in kdgantt1, korganizer
133
set(libkdgantt1_SRCS
134
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttView.cpp
135
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewEventItem.cpp
136
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItem.cpp
137
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItemDrag.cpp
138
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSubwidgets.cpp
139
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSummaryItem.cpp
140
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskItem.cpp
141
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLink.cpp
142
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLinkGroup.cpp
143
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttMinimizeSplitter.cpp
144
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSemiSizingControl.cpp
145
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSizingControl.cpp
146
  ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttXMLTools.cpp
147
)
148
149
150
############### Now, we add the PIM components ###############
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
151
152
  include (kleopatra/ConfigureChecks.cmake)
153
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
154
  if(QGPGME_FOUND)
155
    if (Boost_TOPOLOGICAL_SORT_DIR)
156
      macro_optional_add_subdirectory(kleopatra)
157
    endif(Boost_TOPOLOGICAL_SORT_DIR)
158
    add_subdirectory(wizards)
159
    # The following components depends on QGpgME.
160
    macro_optional_add_subdirectory(kmail)
161
    # If kmail is compiled, KMAIL_SUPPORTED is true (used in several places)
162
    macro_bool_to_01(BUILD_kmail KMAIL_SUPPORTED)
163
    macro_optional_add_subdirectory(kmailcvt)
164
    macro_optional_add_subdirectory(ksendemail)
165
    macro_optional_add_subdirectory(korganizer)
166
  endif(QGPGME_FOUND)
167
168
  if(KDEPIM_BUILD_EVERYTHING)
1.1.38 by Alessandro Ghersi
Import upstream version 4.2.95a
169
    if(EXISTS ${CMAKE_SOURCE_DIR}/akonadi)
170
      macro_optional_add_subdirectory(akonadi)
171
    endif(EXISTS ${CMAKE_SOURCE_DIR}/akonadi)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
172
    macro_optional_add_subdirectory(knode)
173
  endif(KDEPIM_BUILD_EVERYTHING)
174
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
175
  macro_optional_add_subdirectory(akregator)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
176
  macro_optional_add_subdirectory(console)
177
  macro_optional_add_subdirectory(kaddressbook)
178
  macro_optional_add_subdirectory(kalarm)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
179
  macro_optional_add_subdirectory(kjots)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
180
  macro_optional_add_subdirectory(knotes)
181
  macro_optional_add_subdirectory(strigi-analyzer)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
182
  if(Q_WS_X11)
183
    macro_optional_add_subdirectory(ktimetracker)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
184
  endif(Q_WS_X11)
1.1.40 by Christian Mangold
Import upstream version 4.2.96
185
  macro_optional_add_subdirectory(kontact) # must be the last one.
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
186
187
  # Kpilot won't build on Windows
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
188
  if(NOT WIN32)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
189
    macro_optional_add_subdirectory(kpilot)
190
191
    #if(OPENSYNC_FOUND AND GLIB2_FOUND)
192
    #  macro_optional_add_subdirectory(kitchensync)
193
    #endif(OPENSYNC_FOUND AND GLIB2_FOUND)
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
194
  endif(NOT WIN32)
195
1.1.37 by Alessandro Ghersi
Import upstream version 4.2.90
196
  # These targets will always be built
197
  add_subdirectory(libkdepim)
198
  add_subdirectory(libkleo)
199
  add_subdirectory(libkpgp)
200
  add_subdirectory(libksieve)
201
  add_subdirectory(kontactinterfaces)
202
  add_subdirectory(mimelib)
203
  add_subdirectory(kresources)
204
  add_subdirectory(kdgantt1)
205
  add_subdirectory(icons)
206
  add_subdirectory(plugins)
207
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
208
endif (KDEPIM_ONLY_KLEO)
209
210
211
# doc must be a subdir of kdepim or packagers will kill us
1.1.32 by Steve Stalcup
Import upstream version 4.1.96
212
macro_optional_add_subdirectory(doc)
1.1.36 by Scott Kitterman
Import upstream version 4.2.85
213
214
215
# We really want to encourage users to enable/install QGpgME from kdepimlibs
216
if(NOT QGPGME_FOUND)
217
  # Users must be aware that QGpgMe is really needed
218
  message(STATUS "*** WARNING: QGpgME is not installed on your system ***")
219
  message(STATUS "*** It is required if you want to use KMail, KOrganizer or Kleopatra ***")
220
  message(STATUS "*** You are really encouraged to install it ***")
221
endif(NOT QGPGME_FOUND)
222
# All done, let's display what we found...
1.1.22 by Jonathan Riddell
Import upstream version 4.0.80
223
macro_display_feature_log()