TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  1. #################################################
  2. #
  3. # (C) 2010-2011 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. cmake_minimum_required( VERSION 2.8 )
  12. ##### general package setup #####################
  13. project( kdelibs )
  14. set( PACKAGE kdelibs )
  15. set( VERSION "3.5.13" )
  16. ##### include essential cmake modules ###########
  17. include( FindPkgConfig )
  18. include( CheckIncludeFile )
  19. include( CheckSymbolExists )
  20. include( CheckFunctionExists )
  21. include( CheckCSourceCompiles )
  22. include( CheckCXXSourceCompiles )
  23. include( CheckTypeSize )
  24. include( CheckCSourceRuns )
  25. include( CheckLibraryExists )
  26. ##### include our cmake modules #################
  27. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  28. include( TDEMacros )
  29. include( TDESetupPaths )
  30. ##### setup and find essential stuff ############
  31. tde_setup_paths( )
  32. find_package( TQt )
  33. ##### add apidox targets ############
  34. add_custom_target(apidox
  35. COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/qt3/doc/html"
  36. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  37. add_custom_target(install-apidox
  38. COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
  39. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  40. ##### user requested options ####################
  41. OPTION( KDE_MALLOC "Use own malloc implementation" OFF )
  42. OPTION( KDE_MALLOC_DEBUG "Enable debugging in fast malloc" OFF )
  43. OPTION( KDE_MALLOC_FULL "Make alloc as fast as possible" OFF )
  44. OPTION( WITH_ARTS "Build with aRts" ON )
  45. OPTION( WITH_ALSA "Enable ALSA support" ON )
  46. OPTION( WITH_LIBART "Enable libart support (for SVG icons)" OFF )
  47. OPTION( WITH_LIBIDN "Enable support for libidn" OFF )
  48. OPTION( WITH_SSL "Enable support for SSL" ON )
  49. OPTION( WITH_CUPS "Enable CUPS support" ON )
  50. OPTION( WITH_LUA "Enable LUA support" OFF )
  51. OPTION( WITH_TIFF "Enable tiff support" OFF )
  52. OPTION( WITH_JASPER "Enable jasper (jpeg2k) support" OFF )
  53. OPTION( WITH_OPENEXR "Enable openexr support" OFF )
  54. OPTION( WITH_UTEMPTER "Use utempter for utmp management" OFF )
  55. OPTION( WITH_AVAHI "Enable AVAHI support" OFF )
  56. OPTION( WITH_ASPELL "Enable aspell support" OFF )
  57. OPTION( WITH_HSPELL "Enable hspell support" OFF )
  58. ##### set PKG_CONFIG_PATH #######################
  59. set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:${PKGCONFIG_INSTALL_DIR}:${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}" )
  60. ##### check for CPU architecture ################
  61. ### FIXME fast malloc is also available on x86_64 architecture?
  62. if( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i?86" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
  63. set( KDE_MALLOC_X86 1 )
  64. message( STATUS "Found x86 architecture" )
  65. else( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i?86" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
  66. if( KDE_MALLOC )
  67. message( FATAL_ERROR "\nKDE fast malloc is available only on x86 architecture" )
  68. endif( KDE_MALLOC )
  69. endif( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i?86" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
  70. ##### check for operating system ################
  71. if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
  72. set( KDEINIT_SETUID 1 )
  73. set( KDEINIT_OOM_PROTECT 1 )
  74. endif( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
  75. ##### check for compiler capabilities ###########
  76. include( CheckCXXCompilerFlag )
  77. check_cxx_compiler_flag( -Woverloaded-virtual WOVERLOADED_VIRTUAL )
  78. if( WOVERLOADED_VIRTUAL )
  79. set( WOVERLOADED_VIRTUAL -Woverloaded-virtual )
  80. endif( WOVERLOADED_VIRTUAL )
  81. check_cxx_compiler_flag( -fno-builtin NO_BUILTIN )
  82. if( NO_BUILTIN )
  83. endif( NO_BUILTIN )
  84. ##### system checks #############################
  85. check_include_file( "ltdl.h" HAVE_LTDL_H )
  86. if( NOT HAVE_LTDL_H )
  87. tde_message_fatal( "ltdl.h are required, but not found on your system" )
  88. endif( )
  89. check_include_file( "alloca.h" HAVE_ALLOCA_H )
  90. check_include_file( "arpa/nameser8_compat.h" HAVE_ARPA_NAMESER8_COMPAT_H )
  91. check_include_file( "awe_voice.h" HAVE_AWE_VOICE_H )
  92. check_include_file( "Carbon/Carbon.h" HAVE_CARBON_CARBON_H )
  93. check_include_file( "crt_externs.h" HAVE_CRT_EXTERNS_H )
  94. check_include_file( "ctype.h" HAVE_CTYPE_H )
  95. check_include_file( "dirent.h" HAVE_DIRENT_H )
  96. check_include_file( "dld.h" HAVE_DLD_H )
  97. check_include_file( "dlfcn.h" HAVE_DLFCN_H )
  98. check_include_file( "dl.h" HAVE_DL_H )
  99. check_include_file( "float.h" HAVE_FLOAT_H )
  100. check_include_file( "fstab.h" HAVE_FSTAB_H )
  101. check_include_file( "ieeefp.h" HAVE_IEEEFP_H )
  102. check_include_file( "inttypes.h" HAVE_INTTYPES_H )
  103. check_include_file( "libutil.h" HAVE_LIBUTIL_H )
  104. check_include_file( "limits.h" HAVE_LIMITS_H )
  105. check_include_file( "linux/awe_voice.h" HAVE_LINUX_AWE_VOICE_H )
  106. check_include_file( "locale.h" HAVE_LOCALE_H )
  107. check_include_file( "machine/soundcard.h" HAVE_MACHINE_SOUNDCARD_H )
  108. check_include_file( "malloc.h" HAVE_MALLOC_H )
  109. check_include_file( "memory.h" HAVE_MEMORY_H )
  110. check_include_file( "mntent.h" HAVE_MNTENT_H )
  111. check_include_file( "ndir.h" HAVE_NDIR_H )
  112. check_include_file( "netinet/in.h" HAVE_NETINET_IN_H )
  113. check_include_file( "net/if.h" HAVE_NET_IF_H )
  114. check_include_file( "paths.h" HAVE_PATHS_H )
  115. check_include_file( "pty.h" HAVE_PTY_H )
  116. check_include_file( "stdint.h" HAVE_STDINT_H )
  117. check_include_file( "stdio.h" HAVE_STDIO_H )
  118. check_include_file( "stdlib.h" HAVE_STDLIB_H )
  119. check_include_file( "strings.h" HAVE_STRINGS_H )
  120. check_include_file( "string.h" HAVE_STRING_H )
  121. check_include_file( "sysent.h" HAVE_SYSENT_H )
  122. check_include_file( "sys/bitypes.h" HAVE_SYS_BITYPES_H )
  123. check_include_file( "sys/dir.h" HAVE_SYS_DIR_H )
  124. check_include_file( "sys/filio.h" HAVE_SYS_FILIO_H )
  125. check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H )
  126. check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H )
  127. check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H )
  128. check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H )
  129. check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H )
  130. check_include_file( "sys/param.h" HAVE_SYS_PARAM_H )
  131. check_include_file( "sys/prctl.h" HAVE_SYS_PRCTL_H )
  132. check_include_file( "sys/select.h" HAVE_SYS_SELECT_H )
  133. check_include_file( "sys/soundcard.h" HAVE_SYS_SOUNDCARD_H )
  134. check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
  135. check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
  136. check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
  137. check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H )
  138. check_include_file( "sys/xattr.h" sys/xattr.h )
  139. check_include_file( "termios.h" HAVE_TERMIOS_H )
  140. check_include_file( "termio.h" HAVE_TERMIO_H )
  141. check_include_file( "unistd.h" HAVE_UNISTD_H )
  142. check_include_file( "util.h" HAVE_UTIL_H )
  143. check_include_file( "values.h" HAVE_VALUES_H )
  144. # FIXME I'm not sure if test TIME_WITH_SYS_TIME are correct
  145. check_include_file( "sys/time.h" HAVE_SYS_TIME_H )
  146. check_include_file( "time.h" HAVE_TIME_H )
  147. if( HAVE_SYS_TIME_H AND HAVE_TIME_H )
  148. set( TIME_WITH_SYS_TIME 1 )
  149. endif( HAVE_SYS_TIME_H AND HAVE_TIME_H )
  150. check_include_file( "valgrind/memcheck.h" HAVE_VALGRIND_MEMCHECK_H )
  151. check_include_file( "values.h" HAVE_VALUES_H )
  152. check_include_file( "X11/extensions/shape.h" HAVE_X11_EXTENSIONS_SHAPE_H )
  153. check_include_file( "/usr/src/sys/gnu/i386/isa/sound/awe_voice.h" HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H )
  154. check_include_file( "/usr/src/sys/i386/isa/sound/awe_voice.h" HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H )
  155. check_function_exists( random HAVE_RANDOM )
  156. check_symbol_exists( random "stdlib.h" HAVE_RANDOM_PROTO )
  157. check_function_exists( srandom HAVE_SRANDOM )
  158. check_symbol_exists( srandom "stdlib.h" HAVE_SRANDOM_PROTO )
  159. check_function_exists( seteuid HAVE_SETEUID )
  160. check_function_exists( setegid HAVE_SETEGID )
  161. check_function_exists( gethostname HAVE_GETHOSTNAME )
  162. check_symbol_exists( gethostname "unistd.h" HAVE_GETHOSTNAME_PROTO )
  163. check_function_exists( vsnprintf HAVE_VSNPRINTF )
  164. check_function_exists( snprintf HAVE_SNPRINTF )
  165. check_function_exists( setenv HAVE_SETENV )
  166. check_symbol_exists( setenv "stdlib.h" HAVE_SETENV_PROTO )
  167. check_function_exists( unsetenv HAVE_UNSETENV )
  168. check_symbol_exists( unsetenv "stdlib.h" HAVE_UNSETENV_PROTO )
  169. check_function_exists( mkdtemp HAVE_MKDTEMP )
  170. check_symbol_exists( mkdtemp "stdlib.h" HAVE_MKDTEMP_PROTO )
  171. check_function_exists( mkstemp HAVE_MKSTEMP )
  172. check_symbol_exists( mkstemp "stdlib.h" HAVE_MKSTEMP_PROTO )
  173. check_function_exists( mkstemps HAVE_MKSTEMPS )
  174. check_symbol_exists( mkstemps "stdlib.h" HAVE_MKSTEMPS_PROTO )
  175. check_function_exists( initgroups HAVE_INITGROUPS )
  176. check_symbol_exists( initgroups "grp.h" HAVE_INITGROUPS_PROTO )
  177. check_function_exists( strlcat HAVE_STRLCAT )
  178. check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO )
  179. check_function_exists( strlcpy HAVE_STRLCPY )
  180. check_symbol_exists( strlcpy "string.h" HAVE_STRLCPY_PROTO )
  181. check_symbol_exists( S_ISSOCK "sys/stat.h" HAVE_S_ISSOCK )
  182. check_symbol_exists( gethostbyname2 "netdb.h" HAVE_GETHOSTBYNAME2 )
  183. check_symbol_exists( gethostbyname2_r "netdb.h" HAVE_GETHOSTBYNAME2_R )
  184. check_symbol_exists( gethostbyname_r "netdb.h" HAVE_GETHOSTBYNAME_R )
  185. check_symbol_exists( gai_strerror "sys/types.h;sys/socket.h;netdb.h" HAVE_GAI_STRERROR )
  186. check_symbol_exists( getaddrinfo "sys/types.h;sys/socket.h;netdb.h" HAVE_GETADDRINFO )
  187. check_function_exists( usleep HAVE_USLEEP )
  188. check_symbol_exists( usleep "unistd.h" HAVE_USLEEP_PROTO )
  189. check_function_exists( getmntinfo HAVE_GETMNTINFO )
  190. check_function_exists( getnameinfo HAVE_GETNAMEINFO )
  191. check_function_exists( getpagesize HAVE_GETPAGESIZE )
  192. check_function_exists( getpeereid HAVE_GETPEEREID )
  193. check_function_exists( getpeername HAVE_GETPEERNAME )
  194. check_function_exists( getprotobyname_r HAVE_GETPROTOBYNAME_R )
  195. check_function_exists( getpt HAVE_GETPT )
  196. check_function_exists( getservbyname_r HAVE_GETSERVBYNAME_R )
  197. check_function_exists( getservbyport_r HAVE_GETSERVBYPORT_R )
  198. check_function_exists( getsockname HAVE_GETSOCKNAME )
  199. check_function_exists( getsockopt HAVE_GETSOCKOPT )
  200. check_function_exists( gettimeofday HAVE_GETTIMEOFDAY )
  201. check_function_exists( grantpt HAVE_GRANTPT )
  202. check_function_exists( if_nametoindex HAVE_IF_NAMETOINDEX )
  203. check_function_exists( index HAVE_INDEX)
  204. check_function_exists( inet_ntop HAVE_INET_NTOP )
  205. check_function_exists( inet_pton HAVE_INET_PTON )
  206. check_function_exists( setfsent HAVE_SETFSENT )
  207. check_function_exists( setgroups HAVE_SETGROUPS )
  208. check_function_exists( setlocale HAVE_SETLOCALE )
  209. check_function_exists( setmntent HAVE_SETMNTENT )
  210. check_function_exists( setpriority HAVE_SETPRIORITY )
  211. check_function_exists( isnan HAVE_FUNC_ISNAN )
  212. check_function_exists( _finite HAVE_FUNC__FINITE )
  213. check_function_exists( finite HAVE_FUNC_FINITE )
  214. check_function_exists( isinf HAVE_FUNC_ISINF )
  215. check_function_exists( freeaddrinfo HAVE_FREEADDRINFO )
  216. check_function_exists( strtoll HAVE_STRTOLL )
  217. check_function_exists( socket HAVE_SOCKET )
  218. check_function_exists( strfmon HAVE_STRFMON )
  219. check_function_exists( stpcpy HAVE_STPCPY )
  220. check_function_exists( readdir_r HAVE_READDIR_R )
  221. check_function_exists( tcgetattr HAVE_TCGETATTR )
  222. check_function_exists( tcsetattr HAVE_TCSETATTR )
  223. check_function_exists( strcasecmp HAVE_STRCASECMP )
  224. check_function_exists( strchr HAVE_STRCHR )
  225. check_function_exists( strcmp HAVE_STRCMP )
  226. check_function_exists( strrchr HAVE_STRRCHR )
  227. check_function_exists( ptsname HAVE_PTSNAME )
  228. check_function_exists( unlockpt HAVE_UNLOCKPT )
  229. check_function_exists( _getpty HAVE__GETPTY )
  230. check_function_exists( __argz_count HAVE___ARGZ_COUNT )
  231. check_function_exists( __argz_next HAVE___ARGZ_NEXT )
  232. check_function_exists( __argz_stringify HAVE___ARGZ_STRINGIFY )
  233. check_function_exists( sendfile HAVE_SENDFILE )
  234. check_function_exists( rindex HAVE_RINDEX )
  235. check_function_exists( putenv HAVE_PUTENV )
  236. check_function_exists( poll HAVE_POLL )
  237. check_function_exists( memcpy HAVE_MEMCPY )
  238. check_function_exists( madvise HAVE_MADVISE )
  239. check_function_exists( getgroups HAVE_GETGROUPS )
  240. check_function_exists( getcwd HAVE_GETCWD )
  241. check_function_exists( dlerror HAVE_DLERROR )
  242. check_function_exists( crypt HAVE_CRYPT )
  243. check_function_exists( bcopy HAVE_BCOPY )
  244. check_function_exists( alloca HAVE_ALLOCA )
  245. check_function_exists( mmap HAVE_MMAP )
  246. check_function_exists( munmap HAVE_MUNMAP )
  247. check_type_size( "char*" SIZEOF_CHAR_P )
  248. check_type_size( "int" SIZEOF_INT )
  249. check_type_size( "long" SIZEOF_LONG )
  250. check_type_size( "short" SIZEOF_SHORT )
  251. check_type_size( "size_t" SIZEOF_SIZE_T )
  252. check_type_size( "unsigned long" SIZEOF_UNSIGNED_LONG )
  253. set( CMAKE_EXTRA_INCLUDE_FILES "netdb.h" )
  254. check_type_size( "struct addrinfo" STRUCT_ADDRINFO )
  255. set( CMAKE_EXTRA_INCLUDE_FILES "netinet/in.h" )
  256. check_type_size( "struct sockaddr_in6" HAVE_STRUCT_SOCKADDR_IN6 )
  257. unset( CMAKE_EXTRA_INCLUDE_FILES )
  258. check_c_source_compiles("
  259. #include <features.h>
  260. #ifndef __GNU_LIBRARY__
  261. #error
  262. #endif
  263. int main(int argc, char *argv[]) { return 0; } "
  264. _GNU_SOURCE )
  265. check_c_source_compiles("
  266. #include <unistd.h>
  267. int main(int argc, char *argv[]) { revoke(\"/dev/tty\"); return 0; } "
  268. HAVE_REVOKE )
  269. check_c_source_runs("
  270. #include <sys/types.h>
  271. #include <sys/socket.h>
  272. #include <netdb.h>
  273. #include <string.h>
  274. int main()
  275. {
  276. struct addrinfo hint, *res;
  277. int err;
  278. memset(&hint, 0, sizeof(hint));
  279. hint.ai_family = AF_INET;
  280. hint.ai_protocol = 0;
  281. hint.ai_socktype = SOCK_STREAM;
  282. hint.ai_flags = AI_PASSIVE;
  283. err = getaddrinfo(0, \"18300\", &hint, &res); /* kxmlrpc tries this */
  284. if (err != 0 || res == 0 || res->ai_family != AF_INET)
  285. return 1;
  286. return 0;
  287. }"
  288. HAVE_GOOD_GETADDRINFO
  289. )
  290. if( NOT HAVE_GOOD_GETADDRINFO )
  291. set( HAVE_BROKEN_GETADDRINFO 1 )
  292. endif( NOT HAVE_GOOD_GETADDRINFO )
  293. # save CMAKE_REQUIRED_LIBRARIES
  294. set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
  295. set( CMAKE_REQUIRED_LIBRARIES resolv )
  296. check_c_source_compiles("
  297. #include <sys/types.h>
  298. #include <netinet/in.h>
  299. #include <arpa/nameser.h>
  300. #include <resolv.h>
  301. int main(int argc, char *argv[]) { res_init(); return 0; } "
  302. HAVE_RES_INIT )
  303. if( HAVE_RES_INIT )
  304. set( RESOLV_LIBRARIES resolv )
  305. endif( HAVE_RES_INIT)
  306. set( CMAKE_REQUIRED_LIBRARIES util )
  307. check_c_source_runs("
  308. #include <pty.h>
  309. int main(int argc, char* argv) {
  310. int master_fd, slave_fd;
  311. int result;
  312. result = openpty(&master_fd, &slave_fd, 0, 0, 0);
  313. return 0;
  314. }"
  315. HAVE_OPENPTY
  316. )
  317. if( HAVE_OPENPTY )
  318. set( LIB_UTIL util )
  319. endif( )
  320. # restore CMAKE_REQUIRED_LIBRARIES
  321. set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
  322. unset( bak_CMAKE_REQUIRED_LIBRARIES )
  323. # FIXME for unknown reason cmake cannot find su
  324. #find_program( __PATH_SU su )
  325. set( __PATH_SU "/bin/su" )
  326. if( __PATH_SU )
  327. set( DEFAULT_SUPER_USER_COMMAND ${__PATH_SU} )
  328. else( __PATH_SU )
  329. message( STATUS "WARNING: su was not found" )
  330. endif( __PATH_SU )
  331. # FIXME for unknown reason cmake cannot find sudo
  332. # find_program( __PATH_SUDO "sudo" )
  333. set( __PATH_SUDO "/usr/bin/sudo" )
  334. if( WITH_SUDO_KDESU_BACKEND )
  335. if( __PATH_SUDO )
  336. set( DEFAULT_SUPER_USER_COMMAND ${__PATH_SUDO} )
  337. else( __PATH_SUDO )
  338. message( FATAL_ERROR "sudo was chosen as kdesu backend, but was not found in path." )
  339. endif( __PATH_SUDO )
  340. endif( WITH_SUDO_KDESU_BACKEND )
  341. #### set some constants #########################
  342. set( LTDL_OBJDIR \".\" )
  343. set( KDELIBSUFF "${LIB_SUFFIX}" )
  344. set( kde_socklen_t socklen_t )
  345. ##### check for libdl ###########################
  346. find_library( HAVE_LIBDL dl )
  347. if( NOT HAVE_LIBDL-NOTFOUND )
  348. set( DL_LIBRARIES dl )
  349. endif( NOT HAVE_LIBDL-NOTFOUND )
  350. ##### check for utempter ########################
  351. if( WITH_UTEMPTER )
  352. check_include_file( utempter.h HAVE_UTEMPTER_H )
  353. check_library_exists( utempter addToUtmp "" HAVE_ADDTOUTEMP )
  354. if( HAVE_UTEMPTER_H AND HAVE_ADDTOUTEMP )
  355. set( HAVE_UTEMPTER 1 )
  356. set( UTEMPTER_LIBRARY utempter )
  357. else( )
  358. message(FATAL_ERROR "\nutempter are requested, but not found on your system" )
  359. endif( )
  360. endif( )
  361. ##### check for zlib ############################
  362. find_package( ZLIB )
  363. if( NOT ZLIB_FOUND )
  364. message(FATAL_ERROR "\nzlib are required, but not found on your system" )
  365. endif( NOT ZLIB_FOUND )
  366. set( HAVE_LIBZ 1 )
  367. #### check for bzip2 ############################
  368. find_package( BZip2 )
  369. if( NOT BZIP2_FOUND )
  370. # FIXME I'm not sure if bzip2 are required; maybe is optional?
  371. message(FATAL_ERROR "\nbzip2 are required, but not found on your system" )
  372. endif( NOT BZIP2_FOUND )
  373. set( HAVE_BZIP2_SUPPORT 1 )
  374. if( BZIP2_NEED_PREFIX )
  375. set( NEED_BZ2_PREFIX 1 )
  376. endif( BZIP2_NEED_PREFIX )
  377. ##### check for jpeg ############################
  378. find_package( JPEG )
  379. if( NOT JPEG_FOUND )
  380. # FIXME I think jpeg support must be required
  381. message(FATAL_ERROR "\njpeg are required, but not found on your system" )
  382. endif( NOT JPEG_FOUND )
  383. set( HAVE_LIBJPEG 1 )
  384. ##### check for png #############################
  385. find_package( PNG )
  386. if( NOT PNG_FOUND )
  387. # FIXME I think png support must be required
  388. message(FATAL_ERROR "\npng are required, but not found on your system" )
  389. endif( NOT PNG_FOUND )
  390. set( HAVE_LIBPNG 1 )
  391. ##### check for tiff ############################
  392. if( WITH_TIFF )
  393. find_package( TIFF )
  394. if( NOT TIFF_FOUND )
  395. message(FATAL_ERROR "\ntiff are requested, but not found on your system" )
  396. endif( NOT TIFF_FOUND )
  397. set( HAVE_LIBTIFF 1)
  398. endif( WITH_TIFF )
  399. ##### check for jasper ##########################
  400. if( WITH_JASPER )
  401. find_package( Jasper )
  402. if( NOT JASPER_FOUND )
  403. message(FATAL_ERROR "\njasper are requested, but not found on your system" )
  404. endif( NOT JASPER_FOUND )
  405. set( HAVE_JASPER 1 )
  406. endif( WITH_JASPER )
  407. ##### check for openexr #########################
  408. if( WITH_OPENEXR )
  409. pkg_search_module( OPENEXR OpenEXR )
  410. if( NOT OPENEXR_FOUND )
  411. message(FATAL_ERROR "\nopenexr are requested, but not found on your system" )
  412. endif( NOT OPENEXR_FOUND )
  413. set( HAVE_EXR 1 )
  414. endif( WITH_OPENEXR )
  415. ##### check for freetype2 #######################
  416. pkg_search_module( FREETYPE freetype2 )
  417. if( NOT FREETYPE_FOUND )
  418. message(FATAL_ERROR "\nfreetype2 are required, but not found on your system" )
  419. endif( NOT FREETYPE_FOUND )
  420. set( KDEINIT_USE_FONTCONFIG 1 )
  421. ##### check for fontconfig ######################
  422. pkg_search_module( FONTCONFIG fontconfig )
  423. if( NOT FONTCONFIG_FOUND )
  424. message(FATAL_ERROR "\nfontconfig are required, but not found on your system" )
  425. endif( NOT FONTCONFIG_FOUND )
  426. ##### check for Xrandr ##########################
  427. pkg_search_module( XRANDR xrandr>=1.2 )
  428. if( XRANDR_FOUND )
  429. set( XRANDR_SUPPORT 1 )
  430. endif( XRANDR_FOUND )
  431. ##### check for xrender #########################
  432. pkg_search_module( XRENDER xrender )
  433. if( XRENDER_FOUND )
  434. set( HAVE_XRENDER 1 )
  435. endif( XRENDER_FOUND )
  436. ##### check for xcomposite #########################
  437. pkg_search_module( XCOMPOSITE xcomposite )
  438. if( XCOMPOSITE_FOUND )
  439. set( HAVE_XCOMPOSITE 1 )
  440. endif( XCOMPOSITE_FOUND )
  441. ##### check for libxml-2.0 ######################
  442. pkg_search_module( LIBXML2 libxml-2.0 )
  443. if( NOT LIBXML2_FOUND )
  444. message(FATAL_ERROR "\nlibxml-2.0 are required, but not found on your system" )
  445. endif( NOT LIBXML2_FOUND )
  446. ##### check for libxslt ######################
  447. pkg_search_module( LIBXSLT libxslt )
  448. if( NOT LIBXSLT_FOUND )
  449. message(FATAL_ERROR "\nlibxslt are required, but not found on your system" )
  450. endif( NOT LIBXSLT_FOUND )
  451. ##### check for glib-2.0 & friends ##############
  452. pkg_search_module( GLIB2 glib-2.0 )
  453. if( NOT GLIB2_FOUND )
  454. tde_message_fatal( "glib-2.0 are required, but not found on your system" )
  455. endif( )
  456. pkg_search_module( GOBJECT2 gobject-2.0 )
  457. if( NOT GLIB2_FOUND )
  458. tde_message_fatal( "gobject-2.0 are required, but not found on your system" )
  459. endif( )
  460. ##### check for ALSA ############################
  461. # FIXME I propose to drop support for very old ALSA versions (i.e 0.5)
  462. if( WITH_ALSA )
  463. find_package( ALSA )
  464. if( NOT ALSA_FOUND )
  465. message(FATAL_ERROR "\nALSA support are requested, but not found on your system" )
  466. endif( NOT ALSA_FOUND )
  467. set( HAVE_LIBASOUND2 1 )
  468. # FIXME I'm not sure if order is correct
  469. check_include_file( "alsa/asoundlib.h" HAVE_ALSA_ASOUNDLIB_H )
  470. if( NOT HAVE_ALSA_ASOUNDLIB_H )
  471. check_include_file( "sys/asoundlib.h" HAVE_SYS_ASOUNDLIB_H )
  472. endif( NOT HAVE_ALSA_ASOUNDLIB_H )
  473. endif( WITH_ALSA )
  474. ##### check for aRts ############################
  475. if( WITH_ARTS )
  476. pkg_search_module( ARTS arts )
  477. if( ARTS_FOUND )
  478. set( ARTS_MCOPIDL_EXECUTABLE ${ARTS_PREFIX}/bin/mcopidl )
  479. else( ARTS_FOUND )
  480. message(FATAL_ERROR "\naRts are requested, but not found on your system" )
  481. endif( ARTS_FOUND )
  482. else( WITH_ARTS )
  483. set( WITHOUT_ARTS 1 )
  484. endif( WITH_ARTS )
  485. ##### check for Xft #############################
  486. if( KDEINIT_USE_XFT )
  487. pkg_search_module( XFT xft )
  488. if( NOT XFT_FOUND )
  489. message(FATAL_ERROR "\nXft are required, but not found on your system" )
  490. endif( NOT XFT_FOUND )
  491. endif( KDEINIT_USE_XFT )
  492. ##### check for libart ##########################
  493. if( WITH_LIBART )
  494. pkg_search_module( LIBART libart-2.0 )
  495. if( NOT LIBART_FOUND )
  496. message(FATAL_ERROR "\nlibart-2.0 support are requested, but not found on your system" )
  497. endif( NOT LIBART_FOUND )
  498. set( HAVE_LIBART 1 )
  499. endif( WITH_LIBART )
  500. ##### check for libidn ##########################
  501. if( WITH_LIBIDN )
  502. pkg_search_module( LIBIDN libidn )
  503. if( NOT LIBIDN_FOUND )
  504. message(FATAL_ERROR "\nlibidn support are requested, but not found on your system" )
  505. endif( NOT LIBIDN_FOUND )
  506. set( HAVE_LIBIDN 1 )
  507. check_include_file( "idna.h" HAVE_IDNA_H )
  508. check_include_file( "punycode.h" HAVE_PUNYCODE_H )
  509. check_include_file( "stringprep.h" HAVE_STRINGPREP_H )
  510. endif( WITH_LIBIDN )
  511. ##### check for openssl #########################
  512. if( WITH_SSL )
  513. pkg_search_module( SSL openssl )
  514. if( NOT SSL_FOUND )
  515. message(FATAL_ERROR "\nSSL support are requested, but openssl is not found on your system" )
  516. endif( NOT SSL_FOUND )
  517. set( KSSL_HAVE_SSL 1 )
  518. set( HAVE_SSL 1 )
  519. endif( WITH_SSL )
  520. ##### check for cups ############################
  521. # FIXME CUPS must be at least 1.1.9
  522. if( WITH_CUPS )
  523. find_package( Cups )
  524. if( NOT CUPS_FOUND )
  525. message(FATAL_ERROR "\nCUPS support are requested, but not found on your system" )
  526. endif( NOT CUPS_FOUND )
  527. set( HAVE_CUPS 1 )
  528. # FIXME if CUPS is at least 1.1.20, doesn't have password caching
  529. set( HAVE_CUPS_NO_PWD_CACHE 1 )
  530. endif( WITH_CUPS )
  531. ##### check for LUA #############################
  532. if( WITH_LUA )
  533. message(FATAL_ERROR "\nLUA support are not ready yet" )
  534. pkg_search_module( LUA lua )
  535. if( NOT LUA_FOUND )
  536. message(FATAL_ERROR "\nLUA support are requested, but not found on your system" )
  537. endif( NOT LUA_FOUND )
  538. set( HAVE_LUA 1 )
  539. endif( WITH_LUA )
  540. ##### check for avahi ###########################
  541. if( WITH_AVAHI )
  542. if( WITH_QT4 )
  543. endif( WITH_QT4 )
  544. if( WITH_QT3 )
  545. pkg_search_module( AVAHI avahi-tqt )
  546. if( NOT AVAHI_FOUND )
  547. message(FATAL_ERROR "\navahi support are requested, but not found on your system" )
  548. endif( NOT AVAHI_FOUND )
  549. set( AVAHI_API_0_6 1 )
  550. endif( WITH_QT3 )
  551. endif( )
  552. ##### check for aspell ##########################
  553. # we need ASPELL_DATADIR too
  554. if( WITH_ASPELL )
  555. find_package( ASPELL )
  556. if( NOT ASPELL_FOUND )
  557. message(FATAL_ERROR "\nASPELL support are requested, but not found on your system" )
  558. endif( NOT ASPELL_FOUND )
  559. endif( WITH_ASPELL )
  560. ##### check for hspell ##########################
  561. if( WITH_HSPELL )
  562. find_package( HSPELL )
  563. if( NOT HSPELL_FOUND )
  564. message(FATAL_ERROR "\nHSPELL support are requested, but not found on your system" )
  565. endif( NOT HSPELL_FOUND )
  566. endif( WITH_HSPELL )
  567. ##### write configure files #####################
  568. configure_file( config.h.cmake config.h )
  569. configure_file( dcop/dcop-path.h.cmake dcop/dcop-path.h )
  570. configure_file( kdecore/kdemacros.h.cmake kdecore/kdemacros.h )
  571. configure_file( kjs/global.h.in kjs/global.h )
  572. configure_file( kio/kssl/ksslconfig.h.cmake kio/kssl/ksslconfig.h )
  573. configure_file( kdoctools/checkXML.cmake kdoctools/checkXML )
  574. ##### tools #####################################
  575. set( KDE3_DCOPIDL_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl/dcopidl )
  576. set( KDE3_DCOPIDL2CPP_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl2cpp/dcopidl2cpp )
  577. set( KDE3_MEINPROC_EXECUTABLE ${CMAKE_BINARY_DIR}/kdoctools/meinproc )
  578. set( KDE3_KCFGC_EXECUTABLE ${CMAKE_BINARY_DIR}/kdecore/kconfig_compiler/kconfig_compiler )
  579. ##### global compiler settings ##################
  580. add_definitions(
  581. -DHAVE_CONFIG_H
  582. )
  583. set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
  584. set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
  585. set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
  586. ##### headers ###################################
  587. install( FILES
  588. kde.pot
  589. DESTINATION ${INCLUDE_INSTALL_DIR} )
  590. ##### subdirectories ############################
  591. add_subdirectory( dcop )
  592. add_subdirectory( libltdl )
  593. add_subdirectory( kglib )
  594. add_subdirectory( kdefx )
  595. add_subdirectory( kdecore )
  596. add_subdirectory( kunittest )
  597. add_subdirectory( kdeui )
  598. add_subdirectory( kdesu )
  599. add_subdirectory( kjs )
  600. add_subdirectory( kwallet )
  601. add_subdirectory( kio )
  602. add_subdirectory( kded )
  603. # FIXME this directory/target doesn't exists
  604. # add_subdirectory( kded_post )
  605. add_subdirectory( kdoctools )
  606. add_subdirectory( doc )
  607. add_subdirectory( kparts )
  608. add_subdirectory( kutils )
  609. add_subdirectory( kspell2 )
  610. add_subdirectory( kmdi )
  611. add_subdirectory( kinit )
  612. add_subdirectory( kdeprint )
  613. add_subdirectory( kab )
  614. add_subdirectory( kresources )
  615. add_subdirectory( kabc )
  616. add_subdirectory( arts )
  617. add_subdirectory( interfaces )
  618. add_subdirectory( kate )
  619. add_subdirectory( kcert )
  620. if( XRANDR_FOUND )
  621. add_subdirectory( krandr )
  622. endif( XRANDR_FOUND )
  623. add_subdirectory( khtml )
  624. add_subdirectory( kcmshell )
  625. add_subdirectory( kconf_update )
  626. add_subdirectory( kdewidgets )
  627. add_subdirectory( kimgio )
  628. add_subdirectory( kioslave )
  629. add_subdirectory( kstyles )
  630. add_subdirectory( libkmid )
  631. add_subdirectory( libkscreensaver )
  632. add_subdirectory( networkstatus )
  633. add_subdirectory( knewstuff )
  634. add_subdirectory( krsync )
  635. add_subdirectory( licenses )
  636. add_subdirectory( dnssd )
  637. add_subdirectory( pics )
  638. add_subdirectory( mimetypes )
  639. ##### install import cmake modules ###############
  640. tde_install_export( )