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

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