succesfully -> successfully
[kdepim.git] / CMakeLists.txt
blobab1191968ce121ba99097f4f554ea6b7c808636b
1 project(kdepim)
3 option(KDE4_KDEPIM_NEW_DISTRLISTS "Whether to use new distribution lists, which stores them like normal contacts; useful for Kolab")
4 if(KDE4_KDEPIM_NEW_DISTRLISTS)
5   add_definitions (-DKDEPIM_NEW_DISTRLISTS)
6 endif(KDE4_KDEPIM_NEW_DISTRLISTS)
8 add_definitions ( -DTest1Area=5121 ) # jstaniek
10 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
12 # search packages used by KDE
13 find_package (KDE4 REQUIRED)
14 include(KDE4Defaults)
15 include(MacroLibrary)
16 include(MacroOptionalAddSubdirectory)
17 include(CheckIncludeFiles)
18 include(FindKdepimLibs)
20 if(WIN32)
21   # detect oxygen icon dir at configure time based on KDEDIRS - there may be different package installation locations
22   execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path icon OUTPUT_VARIABLE _dir ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
23   file(TO_CMAKE_PATH "${_dir}" __dir)
24   find_path(KDE4_ICON_DIR oxygen PATHS
25       ${__dir}
26   )
27   message(STATUS "using oxygen application icons from ${KDE4_ICON_DIR}")
28 else(WIN32)
29     set (KDE4_ICON_DIR  ${CMAKE_INSTALL_PREFIX}/share/icons)
30 endif(WIN32)
32 # this macro exists to work around a stupid Mac OS X linker bug
33 # where it can't handle the same library being referenced multiple
34 # times on the linker line
35 macro (KDEPIM4_LINK_UNIQUE_LIBRARIES)
36   set(LINK_ARG_LIST)  
37   foreach(arg ${ARGN})
38     set(LINK_ARG_FOUND FALSE)
39     foreach(existing ${LINK_ARG_LIST})
40       if(${arg} STREQUAL ${existing})
41         set(LINK_ARG_FOUND)
42       endif(${arg} STREQUAL ${existing})
43     endforeach(existing)
45     if(NOT ${LINK_ARG_FOUND})
46       list(APPEND LINK_ARG_LIST ${arg})
47     endif(NOT ${LINK_ARG_FOUND})
48   endforeach(arg)
50   target_link_libraries(${LINK_ARG_LIST})
51 endmacro (KDEPIM4_LINK_UNIQUE_LIBRARIES)
53 find_package(Boost REQUIRED)
54 macro_log_feature(Boost_FOUND "boost" "Boost C++ Libraries" "http://www.boost.org/" TRUE "" "Required by Akonadi and kleopatra")
56 if ( ONLY_KLEO )
57   find_package(QGpgme REQUIRED)
59   add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
61   include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${QT_QTDBUS_INCLUDE_DIR} )
63   include (kleopatra/ConfigureChecks.cmake)
65   add_subdirectory(libkleo)
67   find_path(TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
68   if(TOPOLOGICAL_SORT_DIR)
69     macro_optional_add_subdirectory(kleopatra)
70   else(TOPOLOGICAL_SORT_DIR)
71     message(STATUS "topological_sort.hpp is necessary to compile kleopatra. Please install package which contains it.")
72   endif(TOPOLOGICAL_SORT_DIR)
74   macro_optional_add_subdirectory(doc)
76 else ( ONLY_KLEO )
77   # regular case, build everything
79   find_package(Akonadi REQUIRED)
81   if ( NOT EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
82         message ( FATAL_ERROR "libkdepim directory not found" ) # needed for Kode to compile correctly
83   endif ( NOT EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
84   find_package(Kode REQUIRED)
85   find_package(ZLIB REQUIRED)
86   find_package(Strigi REQUIRED)
87   find_package(QGpgme)
89   if(Q_WS_X11)
90     macro_log_feature(X11_Xscreensaver_LIB "libXss" "X Window Screen Saver Development Library" "http://xorg.freedesktop.org" FALSE "" "Required for building the KTimeTracker Program")
91   endif(Q_WS_X11)
93   if (NOT WIN32)
94      set(OPENSYNC_MIN_VERSION 0.38)
95      macro_optional_find_package(OpenSync)
96      macro_log_feature(OPENSYNC_FOUND "opensync" "OpenSync Development Libraries" "http://www.opensync.org" FALSE "0.38 or greater" "Needed to provide syncing functionality in KDE PIM applications. Necessary to compile kitchensync.")
97      macro_optional_find_package(GLIB2)
98      macro_log_feature(GLIB2_FOUND "glib2" "Low-level core library for data structure handling, portability wrappers, etc." "http://www.gtk.org" FALSE "2.x" "Needed to provide synching applications from KDE PIM applications. Necessary to compile kitchensync and other PIM applications.")
99   endif (NOT WIN32)
101   macro_optional_find_package(GNOKII)
102   macro_bool_to_01(GNOKII_FOUND HAVE_GNOKII_H)
103   macro_log_feature(GNOKII_FOUND "gnokii" "Gnokii Development Libraries" "http://www.gnokii.org" FALSE "" "Needed to provide the ability to import and export KDE addressbook entries to/from mobile phones that are accessible via gnokii")
105   macro_optional_find_package(Soprano)
106   macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "" FALSE "" "Soprano is needed for Nepomuk")
108   macro_optional_find_package(Nepomuk)
109   macro_log_feature(Nepomuk_FOUND "Nepomuk" "Nepomuk" "http://www.kde.org" FALSE "" "For adding desktop-wide tagging support to kmail")
111   find_program(XSLTPROC_EXECUTABLE xsltproc)
112   macro_log_feature(XSLTPROC_EXECUTABLE "xsltproc" "The command line XSLT processor from libxslt" "http://xmlsoft.org/XSLT/" FALSE "" "Needed for building Akonadi resources. Recommended.")
114   add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
116   include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDEPIMLIBS_INCLUDE_DIR} ${KDE4_INCLUDES} ${QT_QTDBUS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libkdepim/)
118   include (kleopatra/ConfigureChecks.cmake)
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   )
127   set(libknoteseditor_SRCS
128     ${CMAKE_SOURCE_DIR}/knotes/knoteedit.cpp
129   )
131   set(libkdgantt1_SRCS
132      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttView.cpp
133      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewEventItem.cpp
134      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItem.cpp
135      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewItemDrag.cpp
136      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSubwidgets.cpp
137      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewSummaryItem.cpp
138      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskItem.cpp
139      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLink.cpp
140      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttViewTaskLinkGroup.cpp
141      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttMinimizeSplitter.cpp
142      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSemiSizingControl.cpp
143      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttSizingControl.cpp
144      ${CMAKE_SOURCE_DIR}/kdgantt1/KDGanttXMLTools.cpp
145   )
147   macro_optional_add_subdirectory(doc)
148   add_subdirectory(kode)
149   macro_optional_add_subdirectory(akonadi)
150   add_subdirectory(libkdepim)
151   add_subdirectory(libkholidays)
152   add_subdirectory(kontactinterfaces)
154   find_path(TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
155   if(QGPGME_FOUND)
156      if(TOPOLOGICAL_SORT_DIR)
157         macro_optional_add_subdirectory(kleopatra)
158      else(TOPOLOGICAL_SORT_DIR)
159         message(STATUS "topological_sort.hpp is necessary to compile kleopatra. Please install package which contains it.")
160      endif(TOPOLOGICAL_SORT_DIR)
161      add_subdirectory(libkleo)
162   endif(QGPGME_FOUND)
164   add_subdirectory(libkpgp)
165   add_subdirectory(libksieve)
166   add_subdirectory(mimelib)
167   add_subdirectory(icons)
168   macro_optional_add_subdirectory(akregator)
169   macro_optional_add_subdirectory(knode)
170   macro_optional_add_subdirectory(kjots)
172   if(QGPGME_FOUND)
173     set(KMAIL_SUPPORTED TRUE)
174     add_definitions(-DKMAIL_SUPPORTED)
175     message(STATUS "KMail support enabled.")
176     macro_optional_add_subdirectory(kmail)
177   else(QGPGME_FOUND)
178     set(KMAIL_SUPPORTED FALSE)
179     message(STATUS "KMail support DISABLED (QGPGME not found).")
180   endif(QGPGME_FOUND)
182   macro_optional_add_subdirectory(kalarm)
183   macro_optional_add_subdirectory(kaddressbook)
185   if(Q_WS_X11)
186     set(KTIMETRACKER_SUPPORTED TRUE)
187     add_definitions(-DKTIMETRACKER_SUPPORTED)
188     message(STATUS "KTimeTracker support enabled.")
189     macro_optional_add_subdirectory(ktimetracker)
190   else(Q_WS_X11)
191     set(KTIMETRACKER_SUPPORTED FALSE)
192     message(STATUS "KTimeTracker support DISABLED (non-X11 target).")
193   endif (Q_WS_X11)
195   add_subdirectory(kdgantt1)
197   macro_optional_add_subdirectory(strigi-analyzer)
199   if(QGPGME_FOUND AND KMAIL_SUPPORTED)
200      macro_optional_add_subdirectory(kmailcvt)
201      message(STATUS "KMailCVT support enabled.")
202   else(QGPGME_FOUND AND KMAIL_SUPPORTED)
203      message(STATUS "KMailCVT support DISABLED (because KMail support is disabled).")
204   endif(QGPGME_FOUND AND KMAIL_SUPPORTED)
205   macro_optional_add_subdirectory(knotes)
206   macro_optional_add_subdirectory(console)
208   if(QGPGME_FOUND AND KMAIL_SUPPORTED)
209      macro_optional_add_subdirectory(korganizer)
210      message(STATUS "KOrganizer support enabled.")
211   else(QGPGME_FOUND AND KMAIL_SUPPORTED)
212      message(STATUS "KOrganizer support DISABLED (because KMail support is disabled).")
213   endif(QGPGME_FOUND AND KMAIL_SUPPORTED)
215   if(KMAIL_SUPPORTED)
216      macro_optional_add_subdirectory(ksendemail)
217      message(STATUS "KSendEmail support enabled.")
218   else(KMAIL_SUPPORTED)
219      message(STATUS "KSendEmail support DISABLED (because KMail support is disabled).")
220   endif(KMAIL_SUPPORTED)
222   if(NOT WIN32)
223 #enable kmobiletools for 4.2
224 #     set(KMOBILETOOLS_SUPPORTED TRUE)
225 #     add_definitions(-DKMOBILETOOLS_SUPPORTED)
226 #     message(STATUS "KMobileTools support enabled.")
227 #     macro_optional_add_subdirectory(kmobiletools)
228       set(KMOBILETOOLS_SUPPORTED FALSE)
230      set(KPILOT_SUPPORTED TRUE)
231      add_definitions(-DKPILOT_SUPPORTED)
232      message(STATUS "KPilot support enabled.")
233      macro_optional_add_subdirectory(kpilot)
235      if(OPENSYNC_FOUND AND GLIB2_FOUND)
236        set(KITCHENSYNC_SUPPORTED TRUE)
237        add_definitions(-DKITCHENSYNC_SUPPORTED)
238        message(STATUS "KitchenSync support enabled.")
239        macro_optional_add_subdirectory(kitchensync)
240      else(OPENSYNC_FOUND AND GLIB2_FOUND)
241        set(KITCHENSYNC_SUPPORTED FALSE)
242        if(NOT OPENSYNC_FOUND)
243          message(STATUS "KitchenSync support disabled (OpenSync not found).")
244        endif(NOT OPENSYNC_FOUND)
245        if(NOT GLIB2_FOUND)
246          message(STATUS "KitchenSync support disabled (GLIB not found).")
247        endif(NOT GLIB2_FOUND)
248      endif(OPENSYNC_FOUND AND GLIB2_FOUND)
249   else(NOT WIN32)
250      set(KMOBILETOOLS_SUPPORTED FALSE)
251      message(STATUS "KMobileTools support DISABLED (Windows target).")
252      set(KPILOT_SUPPORTED FALSE)
253      message(STATUS "KPilot support DISABLED (Windows target).")
254      set(KITCHENSYNC_SUPPORTED FALSE)
255      message(STATUS "KitchenSync support DISABLED (Windows target).")
256   endif(NOT WIN32)
258 #enable korn in 4.2 if there is interest
259 # macro_optional_add_subdirectory(korn)
260   add_subdirectory(kresources)
261   macro_optional_add_subdirectory(kontact)
263   if(QGPGME_FOUND)
264      add_subdirectory(wizards)
265   endif(QGPGME_FOUND)
267   add_subdirectory(cmake)
269   # maildir access library
270   add_subdirectory(maildir)
272   add_subdirectory(plugins)
274 endif( ONLY_KLEO )
276 macro_display_feature_log()