add missing compatibility bit
[kdelibs.git] / CMakeLists.txt
blob9cba270ee0a9f5eae8db39bc8bcf31e81fa85ac6
1 project(kdelibs)
3 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
4 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
7 ################# set KDE specific information #################
9 set (KDE_VERSION_MAJOR 4)
10 set (KDE_VERSION_MINOR 1)
11 set (KDE_VERSION_RELEASE 64)
12 set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" )
13 set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.1.64 (KDE 4.2 >= 20080828))")
15 set (KDE_DISTRIBUTION_TEXT "compiled sources" CACHE STRING "Indicate the distribution in bug reports" )
17 # win32: give kde home in debug mode a different name as the  release home dir because the settings and caches are different
18 if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
19     set (_KDE_DEFAULT_HOME_POSTFIX "-debug" CACHE STRING "default KDE home directory postfix" )
20 endif (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
21 set (KDE_DEFAULT_HOME ".kde${_KDE_DEFAULT_HOME_POSTFIX}" CACHE STRING "The default KDE home directory" )
23 # this must be before FindKDE4Internal in order to preset the result of the visibility test, so that it will be skipped
24 option(KHTML_BUILD_TESTREGRESSION "Build KHTML's testregression. Note: this disables hidden visibility")
25 # Disable visibility if testregression is built, because the symbols are needed then
26 if (KHTML_BUILD_TESTREGRESSION)
27    set (__KDE_HAVE_GCC_VISIBILITY 0)
28 endif (KHTML_BUILD_TESTREGRESSION)
31 ################# now find all used packages #################
33 find_package(KDE4Internal REQUIRED)
34 include(KDE4Defaults)
35 include (MacroLibrary)
36 if (APPLE)
37    find_package(Carbon REQUIRED)
38 endif (APPLE)
40 if(UNIX AND Q_WS_X11)
41   #X11 Session Management (SM) is required
42   #X11_SM_FOUND is set in FindX11, which is required by KDE4Internal
43   if(NOT X11_SM_FOUND)
44     message(FATAL_ERROR "\nThe X11 Session Management (SM) development package could not be found.\nPlease install libSM.\n")
45   endif(NOT X11_SM_FOUND)
46 endif(UNIX AND Q_WS_X11)
48 #required features
49 find_package(ZLIB REQUIRED)
50 find_package(Strigi REQUIRED)
52 #optional features
53 macro_optional_find_package(BZip2)
54 macro_log_feature(BZIP2_FOUND "BZip2" "A high-quality data compressor" "http://www.bzip.org" FALSE "" "STRONGLY RECOMMENDED: Provides the ability to read and write bzip2 compressed data files.")
56 macro_optional_find_package(OpenSSL)
57 macro_log_feature(OPENSSL_FOUND "OpenSSL" "A toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols" "http://openssl.org" FALSE "" "STRONGLY RECOMMENDED: KDE uses OpenSSL for the bulk of secure communications, including secure web browsing via HTTPS.")
59 macro_optional_find_package(Libintl)
60 macro_log_feature(LIBINTL_FOUND "Libintl" "Library for message translation" "http://www.gnu.org/software/gettext" FALSE "" "STRONGLY RECOMMENDED: Enables KDE to be available in many different languages.")
62 macro_optional_find_package(OpenGL)
63 macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3D graphics applications" "http://mesa3d.sourceforge.net" FALSE "" "STRONGLY RECOMMENDED: The 3D hardware acceleration available through the OpenGL API is used in applications ranging from graphics and modellers to screensavers and video players.")
65 set(SOPRANO_MIN_VERSION "2.0.97")
66 macro_optional_find_package(Soprano)
67 macro_log_feature(Soprano_FOUND "Soprano" "Soprano Libraries" "kdesupport" FALSE "${SOPRANO_MIN_VERSION}" "Provide metadata support (for semantic desktop).")
70 ################# Disallow in-source build #################
72 macro_ensure_out_of_source_build("kdelibs requires an out of source build. Please create a separate build directory and run 'cmake path_to_kdelibs [options]' there.")
74 # ... and warn in case of an earlier in-source build
75 set(generatedFileInSourceDir EXISTS ${kdelibs_SOURCE_DIR}/kdemacros.h OR EXISTS ${kdelibs_SOURCE_DIR}/config.h)
76 if(${generatedFileInSourceDir})
77    message(STATUS "kdemacros.h or config.h exists in your source directory.")
78    message(FATAL_ERROR "Please run svn-clean, it would seem that your source directory has generated files in it.")
79 endif(${generatedFileInSourceDir})
80 #########################################################################
82 add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
83 remove_definitions(-DQT3_SUPPORT_WARNINGS -DQT3_SUPPORT)
86 ################# setup the include directories #################
88 # for including config.h and for includes like <kparts/foo.h>
89 include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/interfaces)
91 # Those variables for  are only valid inside of kdelibs, of course.
92 # Use the one variable for the lib you depend upon.
93 # E.g. kdeui uses ${KDE4_KDECORE_INCLUDES}. Something that depends on kparts uses ${KDE4_KPARTS_INCLUDES}.
95 set(KDE4_KJS_INCLUDES ${CMAKE_SOURCE_DIR}/kjs
96                       ${CMAKE_BINARY_DIR}/kjs)
98 # kdecore depends on Qt (need only headers from kjs)
99 set(KDE4_KDECORE_INCLUDES ${KDE4_KJS_INCLUDES}
100                           ${CMAKE_SOURCE_DIR}/kdecore
101                           ${CMAKE_BINARY_DIR}/kdecore
102                           ${CMAKE_SOURCE_DIR}/kdecore/compression
103                           ${CMAKE_SOURCE_DIR}/kdecore/config
104                           ${CMAKE_SOURCE_DIR}/kdecore/date
105                           ${CMAKE_SOURCE_DIR}/kdecore/io
106                           ${CMAKE_SOURCE_DIR}/kdecore/jobs
107                           ${CMAKE_SOURCE_DIR}/kdecore/kernel
108                           ${CMAKE_SOURCE_DIR}/kdecore/network
109                           ${CMAKE_SOURCE_DIR}/kdecore/services
110                           ${CMAKE_SOURCE_DIR}/kdecore/localization
111                           ${CMAKE_SOURCE_DIR}/kdecore/sycoca
112                           ${CMAKE_SOURCE_DIR}/kdecore/text
113                           ${CMAKE_SOURCE_DIR}/kdecore/util
114                           ${CMAKE_SOURCE_DIR}/kdecore/sonnet
115                           ${QT_INCLUDES}
116                           ${_KDE4_PLATFORM_INCLUDE_DIRS})
117 # kdeui depends on kdecore
118 set(KDE4_KDEUI_INCLUDES ${CMAKE_SOURCE_DIR}/kdeui
119                         ${CMAKE_SOURCE_DIR}/kdeui/actions
120                         ${CMAKE_SOURCE_DIR}/kdeui/colors
121                         ${CMAKE_SOURCE_DIR}/kdeui/config
122                         ${CMAKE_SOURCE_DIR}/kdeui/dialogs
123                         ${CMAKE_SOURCE_DIR}/kdeui/findreplace
124                         ${CMAKE_SOURCE_DIR}/kdeui/fonts
125                         ${CMAKE_SOURCE_DIR}/kdeui/icons
126                         ${CMAKE_SOURCE_DIR}/kdeui/itemviews
127                         ${CMAKE_SOURCE_DIR}/kdeui/jobs
128                         ${CMAKE_SOURCE_DIR}/kdeui/kernel
129                         ${CMAKE_SOURCE_DIR}/kdeui/paged
130                         ${CMAKE_SOURCE_DIR}/kdeui/plotting
131                         ${CMAKE_SOURCE_DIR}/kdeui/shortcuts
132                         ${CMAKE_SOURCE_DIR}/kdeui/sonnet
133                         ${CMAKE_SOURCE_DIR}/kdeui/util
134                         ${CMAKE_SOURCE_DIR}/kdeui/widgets
135                         ${CMAKE_SOURCE_DIR}/kdeui/windowmanagement
136                         ${CMAKE_SOURCE_DIR}/kdeui/xmlgui
137                         ${KDE4_KDECORE_INCLUDES})
139 # kio depends on kdeui
140 set(KDE4_KIO_INCLUDES ${CMAKE_SOURCE_DIR}/kio
141                       ${CMAKE_SOURCE_DIR}/kio/bookmarks
142                       ${CMAKE_SOURCE_DIR}/kio/kio
143                       ${CMAKE_SOURCE_DIR}/kio/kfile
144                       ${KDE4_KDEUI_INCLUDES})
146 # kpty 
147 set(KDE4_KPTY_INCLUDES ${CMAKE_SOURCE_DIR}/kpty ${KDE4_KIO_INCLUDES} )
149 # kparts depends on kio
150 set(KDE4_KPARTS_INCLUDES ${CMAKE_SOURCE_DIR}/kparts
151                          ${KDE4_KIO_INCLUDES})
153 # kde3support depends on kparts
154 set(KDE4_KDE3SUPPORT_INCLUDES ${CMAKE_SOURCE_DIR}/kde3support
155                               ${CMAKE_SOURCE_DIR}/kde3support/kdecore
156                               ${CMAKE_SOURCE_DIR}/kde3support/kdeui
157                               ${CMAKE_SOURCE_DIR}/kde3support/kio
158                               ${KDE4_KPARTS_INCLUDES})
160 set(KDE4_KHTML_INCLUDES ${CMAKE_SOURCE_DIR}/khtml)
163 ################# configure checks and create the configured files #################
165 # ACL stuff (used in kio/ and kioslaves/)
166 find_package(ACL)
167 macro_bool_to_01(ACL_FOUND HAVE_LIBACL HAVE_POSIX_ACL)
168 configure_file(config-acl.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-acl.h )
170 include(ConfigureChecks.cmake)
172 # now create config headers
173 configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
174 configure_file(config-prefix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-prefix.h )
175 configure_file(config-compiler.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-compiler.h )
176 configure_file(config-pty.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-pty.h )
177 configure_file(kdemacros.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h )
179 # these two calls here should go somewhere else, Alex
180 check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
181 check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
184 ################# list the subdirectories #################
186 add_subdirectory( cmake )
187 add_subdirectory( kdecore )
188 add_subdirectory( kdeui )
189 if (UNIX)
190    add_subdirectory( kpty )
191    add_subdirectory( kdesu )
192 endif (UNIX)
193 add_subdirectory( kjs )
194 add_subdirectory( kjsembed )
195 add_subdirectory( kwallet )
196 add_subdirectory( kio )
197 add_subdirectory( solid )
198 add_subdirectory( kded       )
199 add_subdirectory( kde3support  )
200 add_subdirectory( kfile )
201 add_subdirectory( kconf_update )
202 add_subdirectory( kdoctools  )
203 add_subdirectory( kioslave   )
204 add_subdirectory( knewstuff  )
205 add_subdirectory( kparts     )
206 add_subdirectory( kutils     )
207 add_subdirectory( licenses   )
208 add_subdirectory( mimetypes  )
209 add_subdirectory( kinit  )
210 add_subdirectory( threadweaver )
211 add_subdirectory( sonnet  )
212 add_subdirectory( khtml  )
213 add_subdirectory( interfaces  )
214 add_subdirectory( kdewidgets  )
215 add_subdirectory( kate  )
216 add_subdirectory( knotify )
217 add_subdirectory( kimgio )
218 add_subdirectory( dnssd )
219 add_subdirectory( kross )
220 add_subdirectory( security )
221 add_subdirectory( includes )
223 if(Soprano_FOUND)
224   add_subdirectory(nepomuk)
225 endif(Soprano_FOUND)
227 macro_optional_add_subdirectory( doc  )
229 ################# write dependency file which will be installed #################
231 include(CreateKDELibsDependenciesFile.cmake)
233 ################# install files #################
235 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h  DESTINATION  ${INCLUDE_INSTALL_DIR} )
236 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependenciesInternal.cmake DESTINATION ${DATA_INSTALL_DIR}/cmake/modules)
237 # the following will be the correct locations once cmake has the improved FIND_PACKAGE() 
238 # install( FILES ${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake DESTINATION ${PLUGIN_INSTALL_DIR}/cmake RENAME KDE4Config.cmake)
241 macro_display_feature_log()