TDE base libraries and programs
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 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. #################################################
  2. #
  3. # (C) 2010-2012 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # (C) 2014 Timothy Pearson
  7. # kb9vqf (AT) pearsoncomputing (DOT) net
  8. #
  9. # Improvements and feedback are welcome
  10. #
  11. #################################################
  12. cmake_minimum_required( VERSION 2.8 )
  13. ##### general package setup #####################
  14. project( tdebase )
  15. set( PACKAGE tdebase )
  16. set( VERSION R14.1.0 )
  17. ##### include essential cmake modules ###########
  18. include( FindPkgConfig )
  19. include( CheckIncludeFile )
  20. include( CheckIncludeFiles )
  21. include( CheckCSourceRuns )
  22. include( CheckCXXSourceRuns )
  23. include( CheckCXXSourceCompiles )
  24. include( CheckLibraryExists )
  25. include( CheckFunctionExists )
  26. include( CheckSymbolExists )
  27. include( CheckStructHasMember )
  28. include( CheckTypeSize )
  29. ##### include our cmake modules #################
  30. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  31. include( TDEMacros )
  32. ##### setup install paths #######################
  33. include( TDESetupPaths )
  34. tde_setup_paths( )
  35. ##### add apidox targets ############
  36. add_custom_target(apidox
  37. COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/qt3/doc/html"
  38. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  39. add_custom_target(install-apidox
  40. COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
  41. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  42. ##### optional stuff ############################
  43. option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
  44. option( WITH_SASL "Enable SASL support" ${WITH_ALL_OPTIONS} )
  45. option( WITH_LDAP "Enable LDAP support" ${WITH_ALL_OPTIONS} )
  46. option( WITH_SAMBA "Enable SAMBA support" ${WITH_ALL_OPTIONS} )
  47. option( WITH_OPENEXR "Enable openexr support" ${WITH_ALL_OPTIONS} )
  48. option( WITH_XCOMPOSITE "Enable xcomposite support" ${WITH_ALL_OPTIONS} )
  49. option( WITH_XCURSOR "Enable xcursor support" ${WITH_ALL_OPTIONS} )
  50. option( WITH_XFIXES "Enable xfixes support" ${WITH_ALL_OPTIONS} )
  51. option( WITH_XRANDR "Enable xrandr support" ${WITH_ALL_OPTIONS} )
  52. option( WITH_XRENDER "Enable xrender support" ${WITH_ALL_OPTIONS} )
  53. option( WITH_LIBCONFIG "Enable libconfig support" ${WITH_ALL_OPTIONS} )
  54. option( WITH_PCRE "Enable pcre regex support" ON )
  55. option( WITH_XTEST "Enable xtest support" ${WITH_ALL_OPTIONS} )
  56. option( WITH_OPENGL "Enable openGL support" ${WITH_ALL_OPTIONS} )
  57. option( WITH_XSCREENSAVER "Enable xscreensaver support" ${WITH_ALL_OPTIONS} )
  58. option( WITH_LIBART "Enable libart support (for SVG icons and wallpapers)" ${WITH_ALL_OPTIONS} )
  59. option( WITH_LIBUSB "Enable control of some mouse models through libusb" ${WITH_ALL_OPTIONS} )
  60. option( WITH_LIBRAW1394 "Enable visualization of ieee1394 devices through libraw1394" ${WITH_ALL_OPTIONS} )
  61. option( WITH_SUDO_TDESU_BACKEND "Use sudo as backend for tdesu (default is su)" OFF )
  62. option( WITH_SUDO_KONSOLE_SUPER_USER_COMMAND "Use sudo when launching Konsole super user sessions (default is su)" OFF )
  63. option( WITH_PAM "tdm should use PAM" ${WITH_ALL_OPTIONS} )
  64. option( WITH_SHADOW "tdm should use shadow passwords" ${WITH_ALL_OPTIONS} )
  65. option( WITH_XDMCP "xdmcp support for tdm" ${WITH_ALL_OPTIONS} )
  66. option( WITH_XINERAMA "Enable xinerama extension support" ${WITH_ALL_OPTIONS} )
  67. option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} )
  68. option( WITH_I8K "Enable Dell laptop support (ksysguard)" ${WITH_ALL_OPTIONS} )
  69. option( WITH_SENSORS "Enable lm_sensors support (ksysguard)" ${WITH_ALL_OPTIONS} )
  70. option( WITH_HAL "Enable HAL support" OFF )
  71. option( WITH_TDEHWLIB "Enable TDE hardware library support" ${WITH_ALL_OPTIONS} )
  72. option( WITH_UPOWER "Enable UPOWER support" ${WITH_ALL_OPTIONS} )
  73. option( WITH_ELFICON "Enable ELF embedded metadata support" ${WITH_ALL_OPTIONS} )
  74. option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
  75. ##### options comments ##########################
  76. # WITH_SASL affects tdeioslaves(tdeio_ldap tdeio_smtp tdeio_pop3)
  77. # WITH_LDAP affects tdeioslaves(tdeio_ldap)
  78. # WITH_SAMBA affects tdeioslaves(tdeio_samba) kcontrol
  79. # WITH_OPENEXR affects tdeioslaves(thumbnail)
  80. # WITH_XCOMPOSITE affects twin kicker(taskmanager) tdm
  81. # WITH_XCURSOR affects tdeioslaves(thumbnail), kcontrol(input), kdesktop
  82. # WITH_XFIXES affects twin klipper kicker(taskmanager)
  83. # WITH_XRANDR affects tdm, kcontrol(displayconfig randr iccconfig)
  84. # WITH_XRENDER affects twin konsole kicker(taskmanager) kdesktop
  85. # kcontrol(style)
  86. # WITH_XTEST desription adds some hotkey functonality. Its functionality
  87. # replaced by xkb nearly everywhere except the
  88. # mouse gestures. Also it used as a fallback if
  89. # xkb initialization fails.
  90. # WITH_XTEST affects tdm kxkb khotkeys
  91. # WITH_XSCREENSAVER affects kdesktop
  92. # WITH_LIBART affects tdm kcontrol(icons background)
  93. # WITH_LIBUSB affects kcontrol(input)
  94. # WITH_XDMCP affects tdm
  95. # WITH_XINERAMA affects ksplashml twin/compton-tde
  96. # WITH_ARTS affects libkonq khotkeys
  97. # WITH_I8K affects ksysguard
  98. # WITH_SENSORS affects ksysguard
  99. # WITH_HAL affects tdeioslaves(media) ksmserver kicker
  100. # WITH_TDEHWLIB affects tdeioslaves(media), replaces WITH_HAL on systems without HAL
  101. # WITH_LIBRAW1394 affects kcontrol(view1394)
  102. # WITH_PAM affects tdm kdesktop kcheckpass
  103. # WITH_SHADOW affects tdm kcheckpass
  104. # WITH_UPOWER affects ksmserver
  105. # WITH_LIBCONFIG affects twin/compot-tde
  106. # WITH_PCRE affects twin/compot-tde
  107. # WITH_SUDO_TDESU_BACKEND affects tdesu
  108. # WITH_SUDO_KONSOLE_SUPER_USER_COMMAND affects launching Konsole super user sessions
  109. # NOTE: WITH_SHADOW and WITH_PAM shouldn't be set concurrently
  110. # WITH_PAM will override WITH_SHADOW
  111. # NOTE: if WITH_XCOMPOSITE=ON then the following options are also required:
  112. # WITH_XRENDER=ON
  113. # WITH_XFIXES=ON
  114. ##### user requested modules ####################
  115. option( BUILD_ALL "Build all" OFF )
  116. option( BUILD_TDEINIT "Build tdeinit" ${BUILD_ALL} )
  117. option( BUILD_L10N "Build l10n" ${BUILD_ALL} )
  118. option( BUILD_PICS "Build pics" ${BUILD_ALL} )
  119. option( BUILD_APPLNK "Build applnk" ${BUILD_ALL} )
  120. option( BUILD_DOC "Build doc" ${BUILD_ALL} )
  121. option( BUILD_LIBKONQ "Build libkonq" ${BUILD_ALL} )
  122. option( BUILD_KCMINIT "Build kcminit" ${BUILD_ALL} )
  123. option( BUILD_KCONTROL "Build kcontrol" ${BUILD_ALL} )
  124. option( BUILD_TWIN "Build twin" ${BUILD_ALL} )
  125. option( BUILD_KATE "Build kate" ${BUILD_ALL} )
  126. option( BUILD_KONQUEROR "Build konqueror" ${BUILD_ALL} )
  127. option( BUILD_TDEIOSLAVES "Build tdeioslaves" ${BUILD_ALL} )
  128. option( BUILD_KICKER "Build kicker" ${BUILD_ALL} )
  129. option( BUILD_KDESKTOP "Build kdesktop" ${BUILD_ALL} )
  130. option( BUILD_KONSOLE "Build konsole" ${BUILD_ALL} )
  131. option( BUILD_KLIPPER "Build klipper" ${BUILD_ALL} )
  132. option( BUILD_KMENUEDIT "Build kmenuedit" ${BUILD_ALL} )
  133. option( BUILD_TDEPRINT "Build tdeprint" ${BUILD_ALL} )
  134. option( BUILD_KPERSONALIZER "Build kpersonalizer" ${BUILD_ALL} )
  135. option( BUILD_TDEPASSWD "Build tdepasswd" ${BUILD_ALL} )
  136. option( BUILD_KTIP "Build ktip" ${BUILD_ALL} )
  137. option( BUILD_TDEEJECT "Build tdeeject" ${BUILD_ALL} )
  138. option( BUILD_KDIALOG "Build kdialog" ${BUILD_ALL} )
  139. option( BUILD_KREADCONFIG "Build kreadconfig" ${BUILD_ALL} )
  140. option( BUILD_TDESU "Build tdesu" ${BUILD_ALL} )
  141. option( BUILD_TDM "Build tdm" ${BUILD_ALL} )
  142. option( BUILD_KSMSERVER "Build ksmserver" ${BUILD_ALL} )
  143. option( BUILD_KSPLASHML "Build ksplashml" ${BUILD_ALL} )
  144. option( BUILD_STARTTDE "Build starttde" ${BUILD_ALL} )
  145. option( BUILD_KFIND "Build kfind" ${BUILD_ALL} )
  146. option( BUILD_DRKONQI "Build drkonqi" ${BUILD_ALL} )
  147. option( BUILD_KDCOP "Build kdcop" ${BUILD_ALL} )
  148. option( BUILD_TDEDEBUGDIALOG "Build tdedebugdialog" ${BUILD_ALL} )
  149. option( BUILD_KNETATTACH "Build knetattach" ${BUILD_ALL} )
  150. option( BUILD_KPAGER "Build kpager" ${BUILD_ALL} )
  151. option( BUILD_KAPPFINDER "Build kappfinder" ${BUILD_ALL} )
  152. option( BUILD_KCHECKPASS "Build kcheckpass" ${BUILD_ALL} )
  153. option( BUILD_KHELPCENTER "Build khelpcenter" ${BUILD_ALL} )
  154. option( BUILD_KHOTKEYS "Build khotkeys" ${BUILD_ALL} )
  155. option( BUILD_TDESCREENSAVER "Build tdescreensaver" ${BUILD_ALL} )
  156. option( BUILD_KSTART "Build kstart" ${BUILD_ALL} )
  157. option( BUILD_KSYSTRAYCMD "Build ksystraycmd" ${BUILD_ALL} )
  158. option( BUILD_NSPLUGINS "Build nsplugins" ${BUILD_ALL} )
  159. option( BUILD_KSYSGUARD "Build ksysguard" ${BUILD_ALL} )
  160. option( BUILD_KXKB "Build kxkb" ${BUILD_ALL} )
  161. option( BUILD_TSAK "Build tsak" ${BUILD_ALL} )
  162. option( BUILD_TDEKBDLEDSYNC "Build tdekbdledsync" ${BUILD_ALL} )
  163. option( BUILD_KROOTBACKING "Build krootbacking" ${BUILD_ALL} )
  164. option( BUILD_TQT3INTEGRATION "Build tqt3integration" ${BUILD_ALL} )
  165. option( BUILD_CRASHTEST "Build crash test program" ${BUILD_ALL} )
  166. option( BUILD_PROFILE_SHUTDOWN "Build ksmserver shutdown debugging timing markers" OFF )
  167. ##### set PKG_CONFIG_PATH #######################
  168. set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )
  169. ##### configure checks ##########################
  170. include( ConfigureChecks.cmake )
  171. ###### global compiler settings #################
  172. add_definitions(
  173. -DHAVE_CONFIG_H
  174. )
  175. set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
  176. set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
  177. set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
  178. check_type_size( "long long" LONG_LONG )
  179. ##### tdebase directories #######################
  180. add_subdirectory( tdmlib )
  181. tde_conditional_add_subdirectory( BUILD_TDEINIT tdeinit )
  182. tde_conditional_add_subdirectory( BUILD_L10N l10n )
  183. tde_conditional_add_subdirectory( BUILD_PICS pics )
  184. tde_conditional_add_subdirectory( BUILD_APPLNK applnk )
  185. tde_conditional_add_subdirectory( BUILD_DOC doc )
  186. tde_conditional_add_subdirectory( BUILD_LIBKONQ libkonq )
  187. tde_conditional_add_subdirectory( BUILD_KCMINIT kcminit )
  188. add_subdirectory( kcontrol )
  189. tde_conditional_add_subdirectory( BUILD_TWIN twin )
  190. tde_conditional_add_subdirectory( BUILD_KATE kate )
  191. tde_conditional_add_subdirectory( BUILD_KONQUEROR konqueror )
  192. tde_conditional_add_subdirectory( BUILD_TDEIOSLAVES tdeioslave )
  193. tde_conditional_add_subdirectory( BUILD_KICKER kicker )
  194. tde_conditional_add_subdirectory( BUILD_KDESKTOP kdesktop )
  195. tde_conditional_add_subdirectory( BUILD_KONSOLE konsole )
  196. tde_conditional_add_subdirectory( BUILD_KLIPPER klipper )
  197. tde_conditional_add_subdirectory( BUILD_KMENUEDIT kmenuedit )
  198. tde_conditional_add_subdirectory( BUILD_TDEPRINT tdeprint )
  199. tde_conditional_add_subdirectory( BUILD_KPERSONALIZER kpersonalizer )
  200. tde_conditional_add_subdirectory( BUILD_TDEPASSWD tdepasswd )
  201. tde_conditional_add_subdirectory( BUILD_KTIP ktip )
  202. tde_conditional_add_subdirectory( BUILD_TDEEJECT tdeeject )
  203. tde_conditional_add_subdirectory( BUILD_KDIALOG kdialog )
  204. tde_conditional_add_subdirectory( BUILD_KREADCONFIG kreadconfig )
  205. tde_conditional_add_subdirectory( BUILD_TDESU tdesu )
  206. tde_conditional_add_subdirectory( BUILD_TDM tdm )
  207. tde_conditional_add_subdirectory( BUILD_KSMSERVER ksmserver )
  208. tde_conditional_add_subdirectory( BUILD_KSPLASHML ksplashml )
  209. tde_conditional_add_subdirectory( BUILD_KFIND kfind )
  210. tde_conditional_add_subdirectory( BUILD_DRKONQI drkonqi )
  211. tde_conditional_add_subdirectory( BUILD_KDCOP kdcop )
  212. tde_conditional_add_subdirectory( BUILD_TDEDEBUGDIALOG tdedebugdialog )
  213. tde_conditional_add_subdirectory( BUILD_KNETATTACH knetattach )
  214. tde_conditional_add_subdirectory( BUILD_KPAGER kpager )
  215. tde_conditional_add_subdirectory( BUILD_KAPPFINDER kappfinder )
  216. tde_conditional_add_subdirectory( BUILD_KCHECKPASS kcheckpass )
  217. tde_conditional_add_subdirectory( BUILD_KHELPCENTER khelpcenter )
  218. tde_conditional_add_subdirectory( BUILD_KHOTKEYS khotkeys )
  219. tde_conditional_add_subdirectory( BUILD_TDESCREENSAVER tdescreensaver )
  220. tde_conditional_add_subdirectory( BUILD_KSTART kstart )
  221. tde_conditional_add_subdirectory( BUILD_KSYSTRAYCMD ksystraycmd )
  222. tde_conditional_add_subdirectory( BUILD_NSPLUGINS nsplugins )
  223. tde_conditional_add_subdirectory( BUILD_KSYSGUARD ksysguard )
  224. tde_conditional_add_subdirectory( BUILD_KXKB kxkb )
  225. tde_conditional_add_subdirectory( BUILD_TSAK tsak )
  226. tde_conditional_add_subdirectory( BUILD_TDEKBDLEDSYNC tdekbdledsync )
  227. tde_conditional_add_subdirectory( BUILD_KROOTBACKING krootbacking )
  228. tde_conditional_add_subdirectory( BUILD_TQT3INTEGRATION tqt3integration )
  229. ##### install starttde & related stuff ##########
  230. if( BUILD_STARTTDE )
  231. install( PROGRAMS starttde DESTINATION ${BIN_INSTALL_DIR} )
  232. install( PROGRAMS migratekde3 r14-xdg-update release_notes DESTINATION ${BIN_INSTALL_DIR} )
  233. endif()
  234. ##### Checks for a distribution-specific 1st menu item, generally a control center
  235. if(EXISTS "/usr/share/applications/YaST.desktop")
  236. set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/YaST.desktop" )
  237. endif()
  238. if(EXISTS "/usr/share/applications/mageia-drakconf.desktop")
  239. set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mageia-drakconf.desktop" )
  240. endif()
  241. if(EXISTS "/usr/share/applications/pclinuxos-drakconf.desktop")
  242. set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/pclinuxos-drakconf.desktop" )
  243. endif()
  244. if(EXISTS "/usr/share/applications/mandriva-drakconf.desktop")
  245. set( KICKOFF_DIST_CONFIG_SHORTCUT1 "/usr/share/applications/mandriva-drakconf.desktop" )
  246. endif()
  247. ##### Checks for a distribution-specific 2nd menu item, generally a shortcut to graphical package manager
  248. if(EXISTS "/usr/share/applications/package-manager.desktop")
  249. set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/package-manager.desktop" )
  250. endif()
  251. if(EXISTS "/usr/share/applications/rpmdrake.desktop")
  252. set( KICKOFF_DIST_CONFIG_SHORTCUT2 "/usr/share/applications/rpmdrake.desktop" )
  253. endif()
  254. ##### write configure files #####################
  255. configure_file( config.h.cmake config.h @ONLY )