3 # where to look first for cmake modules. This line must be the first one or cmake will use the system's FindFoo.cmake
4 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
7 ############### Build Options ###############
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)
12 # if KDEPIM_ENTERPRISE_BUILD is defined, KDEPIM_ONLY_KLEO is disabled
13 if(KDEPIM_ENTERPRISE_BUILD)
14 set(KDEPIM_ONLY_KLEO FALSE)
15 set(KDEPIM_BUILD_EVERYTHING FALSE)
16 message(STATUS "Enterprise build is enabled.")
17 else(KDEPIM_ENTERPRISE_BUILD)
18 # if KDEPIM_ONLY_KLEO is defined, KDEPIM_BUILD_EVERYTHING is disabled.
20 set(KDEPIM_BUILD_EVERYTHING FALSE)
21 set(KDEPIM_DEFINITIONS "-DHAVE_CONFIG_H=1")
22 message(STATUS "Only libkleo and Kleopatra will be built.")
23 endif(KDEPIM_ONLY_KLEO)
25 set(KDEPIM_BUILD_EVERYTHING TRUE)
26 message(STATUS "Enterprise build is disabled.")
27 endif(KDEPIM_ENTERPRISE_BUILD)
29 # config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
30 configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
33 ############### search packages used by KDE ###############
35 find_package(KDE4 REQUIRED)
38 include(CheckIncludeFiles)
39 find_package(KdepimLibs 4.3.0 REQUIRED)
42 ############### search Boost ###############
44 set(Boost_MINIMUM_VERSION "1.33.1")
46 macro_log_feature(Boost_FOUND "boost" "Boost C++ Libraries" "http://www.boost.org" TRUE "" "Required by several critical KDEPIM apps.")
48 # Kleopatra needs to know if the topological.hpp header exists (part of Boost_graph).
49 find_path(Boost_TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
50 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")
53 ############### Windows specific ###############
56 # detect oxygen icon dir at configure time based on KDEDIRS - there may be different package installation locations
57 execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path icon OUTPUT_VARIABLE _dir ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
58 file(TO_CMAKE_PATH "${_dir}" __dir)
59 find_path(KDE4_ICON_DIR oxygen PATHS
62 message(STATUS "using oxygen application icons from ${KDE4_ICON_DIR}")
64 set (KDE4_ICON_DIR ${CMAKE_INSTALL_PREFIX}/share/icons)
68 ############### Compatibility ###############
69 # Support building against earlier kdelibs or kdepimlibs
70 # TODO Remove this section once KDE 4.3 is out.
72 if(NOT DEFINED KDE4_KHOLIDAYS_LIBS)
73 set(KDE4_KHOLIDAYS_LIBS kholidays)
74 endif(NOT DEFINED KDE4_KHOLIDAYS_LIBS)
77 ############### ONLY_KLEO ###############
79 # The KDEPIM_ONLY_KLEO option is true
82 macro_log_feature(QGPGME_FOUND "qgpgme" "The QGpgME library." "http://www.kde.org" TRUE "" "QGpgME is required to build Kleopatra.")
84 add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${KDEPIM_DEFINITIONS})
85 include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${QT_QTDBUS_INCLUDE_DIR})
86 include(kleopatra/ConfigureChecks.cmake)
88 add_subdirectory(libkleo)
89 if (Boost_TOPOLOGICAL_SORT_DIR)
90 macro_optional_add_subdirectory(kleopatra)
91 endif (Boost_TOPOLOGICAL_SORT_DIR)
93 else(KDEPIM_ONLY_KLEO)
96 ############### Find the stuff we need ###############
99 macro_log_feature(Akonadi_FOUND "Akonadi" "Akonadi client libraries (from kdepimlibs)" "http://pim.kde.org/akonadi" TRUE "" "Akonadi is required to build KDEPIM")
102 macro_log_feature(ZLIB_FOUND "zlib" "The Zlib compression library" "http://www.zlib.net" TRUE "" "")
105 macro_log_feature(STRIGI_FOUND "Strigi" "Index metadata of files" "http:// strigi.sourceforge.net" TRUE "" "")
108 macro_log_feature(QGPGME_FOUND "QGpgME" "The QGpgME library." "http://www.kde.org" FALSE "" "QGpgME is required to build KMail, KOrganizer and Kleopatra")
110 macro_optional_find_package(Soprano)
111 macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" FALSE "" "" "Soprano is needed for Nepomuk")
113 macro_optional_find_package(Nepomuk)
114 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")
117 ############### Needed commands before building anything ###############
119 add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} ${KDEPIM_DEFINITIONS})
120 include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDEPIMLIBS_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QT_QTDBUS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libkdepim)
123 ############### Code used in several places ###############
124 # TODO Remove from the top CMakeLists.
126 # used in knotes, kontact/plugins/knotes, kresources/egroupware, kresources/kolab/knotes, kresources/scalix/knotes, wizard
127 set(libknotesresources_SRCS
128 ${CMAKE_SOURCE_DIR}/knotes/resourcemanager.cpp
129 ${CMAKE_SOURCE_DIR}/knotes/resourcenotes.cpp
130 ${CMAKE_SOURCE_DIR}/knotes/resourcelocal.cpp
131 ${CMAKE_SOURCE_DIR}/knotes/resourcelocalconfig.cpp
134 # used in knotes, kontact/plugins/knotes
135 set(libknoteseditor_SRCS
136 ${CMAKE_SOURCE_DIR}/knotes/knoteedit.cpp
139 # used in kdgantt1, korganizer
141 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttView.cpp
142 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewEventItem.cpp
143 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItem.cpp
144 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItemDrag.cpp
145 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSubwidgets.cpp
146 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSummaryItem.cpp
147 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskItem.cpp
148 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLink.cpp
149 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLinkGroup.cpp
150 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttMinimizeSplitter.cpp
151 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSemiSizingControl.cpp
152 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSizingControl.cpp
153 ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttXMLTools.cpp
157 ############### Now, we add the PIM components ###############
159 include (kleopatra/ConfigureChecks.cmake)
161 # These targets will always be built
162 add_subdirectory(libkdepim)
163 add_subdirectory(libkleo)
164 add_subdirectory(libkpgp)
165 add_subdirectory(libksieve)
166 add_subdirectory(kontactinterfaces)
167 add_subdirectory(mimelib)
168 add_subdirectory(kresources)
169 add_subdirectory(kdgantt1)
170 add_subdirectory(akonadiconsole)
171 add_subdirectory(cmake)
172 add_subdirectory(icons)
173 add_subdirectory(plugins)
176 if (Boost_TOPOLOGICAL_SORT_DIR)
177 macro_optional_add_subdirectory(kleopatra)
178 endif(Boost_TOPOLOGICAL_SORT_DIR)
179 add_subdirectory(wizards)
180 # The following components depends on QGpgME.
181 macro_optional_add_subdirectory(kmail)
182 # If kmail is compiled, KMAIL_SUPPORTED is true (used in several places)
183 macro_bool_to_01(BUILD_kmail KMAIL_SUPPORTED)
184 macro_optional_add_subdirectory(kmailcvt)
185 macro_optional_add_subdirectory(ksendemail)
186 macro_optional_add_subdirectory(korganizer)
189 if(KDEPIM_BUILD_EVERYTHING)
190 macro_optional_add_subdirectory(akonadi)
191 macro_optional_add_subdirectory(knode)
192 endif(KDEPIM_BUILD_EVERYTHING)
194 macro_optional_add_subdirectory(akregator)
195 macro_optional_add_subdirectory(console)
196 macro_optional_add_subdirectory(kaddressbook)
197 macro_optional_add_subdirectory(kalarm)
198 # macro_optional_add_subdirectory(kcontactmanager)
199 macro_optional_add_subdirectory(kjots)
200 macro_optional_add_subdirectory(knotes)
201 macro_optional_add_subdirectory(kontact)
202 macro_optional_add_subdirectory(strigi-analyzer)
205 macro_optional_add_subdirectory(ktimetracker)
208 # Kpilot won't build on Windows
210 macro_optional_add_subdirectory(kpilot)
212 #if(OPENSYNC_FOUND AND GLIB2_FOUND)
213 # macro_optional_add_subdirectory(kitchensync)
214 #endif(OPENSYNC_FOUND AND GLIB2_FOUND)
217 endif (KDEPIM_ONLY_KLEO)
220 # doc must be a subdir of kdepim or packagers will kill us
221 macro_optional_add_subdirectory(doc)
224 # We really want to encourage users to enable/install QGpgME from kdepimlibs
226 # Users must be aware that QGpgMe is really needed
227 message(STATUS "*** WARNING: QGpgME is not installed on your system ***")
228 message(STATUS "*** It is required if you want to use KMail, KOrganizer or Kleopatra ***")
229 message(STATUS "*** You are really encouraged to install it ***")
230 endif(NOT QGPGME_FOUND)
231 # All done, let's display what we found...
232 macro_display_feature_log()