TDE games
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.
 
 
 
 
 
 

169 lines
6.8 KiB

  1. #################################################
  2. #
  3. # (C) 2016 Alexander Golubev
  4. # fatzer2 (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( tdegames )
  14. set( VERSION R14.1.0 )
  15. ##### include essential cmake modules ###########
  16. include( FindPkgConfig )
  17. include( CheckIncludeFile )
  18. include( CheckLibraryExists )
  19. include( CheckSymbolExists )
  20. include( CheckCXXSourceCompiles )
  21. ##### include our cmake modules #################
  22. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  23. include( TDEMacros )
  24. ##### setup install paths #######################
  25. include( TDESetupPaths )
  26. tde_setup_paths( )
  27. ##### optional stuff ############################
  28. option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
  29. option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} )
  30. ##### options comments ##########################
  31. # WITH_ARTS affects kbounce
  32. # if disabled the game will have no sound
  33. # NOTE: ARTS is unconditionally required to build kolf and kasteroids
  34. ##### user requested modules ####################
  35. option( BUILD_ALL "Build all" OFF )
  36. option( BUILD_ATLANTIK "Build atlantik" ${BUILD_ALL} )
  37. option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
  38. option( BUILD_KASTEROIDS "Build kasteroids" ${BUILD_ALL} )
  39. option( BUILD_KATOMIC "Build katomic" ${BUILD_ALL} )
  40. option( BUILD_KBACKGAMMON "Build kbackgammon" ${BUILD_ALL} )
  41. option( BUILD_KBATTLESHIP "Build kbattleship" ${BUILD_ALL} )
  42. option( BUILD_KBLACKBOX "Build kblackbox" ${BUILD_ALL} )
  43. option( BUILD_KBOUNCE "Build kbounce" ${BUILD_ALL} )
  44. option( BUILD_KENOLABA "Build kenolaba" ${BUILD_ALL} )
  45. option( BUILD_KFOULEGGS "Build kfouleggs" ${BUILD_ALL} )
  46. option( BUILD_KGOLDRUNNER "Build kgoldrunner" ${BUILD_ALL} )
  47. option( BUILD_KJUMPINGCUBE "Build kjumpingcube" ${BUILD_ALL} )
  48. option( BUILD_KLICKETY "Build klickety" ${BUILD_ALL} )
  49. option( BUILD_KLINES "Build klines" ${BUILD_ALL} )
  50. option( BUILD_KMAHJONGG "Build kmahjongg" ${BUILD_ALL} )
  51. option( BUILD_KMINES "Build kmines" ${BUILD_ALL} )
  52. option( BUILD_KNETWALK "Build knetwalk" ${BUILD_ALL} )
  53. option( BUILD_KOLF "Build kolf" ${BUILD_ALL} )
  54. option( BUILD_KONQUEST "Build konquest" ${BUILD_ALL} )
  55. option( BUILD_KPAT "Build kpat" ${BUILD_ALL} )
  56. option( BUILD_KPOKER "Build kpoker" ${BUILD_ALL} )
  57. option( BUILD_KREVERSI "Build kreversi" ${BUILD_ALL} )
  58. option( BUILD_KSAME "Build ksame" ${BUILD_ALL} )
  59. option( BUILD_KSHISEN "Build kshisen" ${BUILD_ALL} )
  60. option( BUILD_KSIRTET "Build ksirtet" ${BUILD_ALL} )
  61. option( BUILD_KSMILETRIS "Build ksmiletris" ${BUILD_ALL} )
  62. option( BUILD_KSNAKE "Build ksnake" ${BUILD_ALL} )
  63. option( BUILD_KSOKOBAN "Build ksokoban" ${BUILD_ALL} )
  64. option( BUILD_KSPACEDUEL "Build kspaceduel" ${BUILD_ALL} )
  65. option( BUILD_KTRON "Build ktron" ${BUILD_ALL} )
  66. option( BUILD_KTUBERLING "Build ktuberling" ${BUILD_ALL} )
  67. option( BUILD_LIBTDEGAMES "Build libtdegames" ${BUILD_ALL} )
  68. option( BUILD_LSKAT "Build lskat" ${BUILD_ALL} )
  69. option( BUILD_TWIN4 "Build twin4" ${BUILD_ALL} )
  70. ##### configure checks ##########################
  71. include( ConfigureChecks.cmake )
  72. ###### global compiler settings #################
  73. add_definitions(
  74. -DHAVE_CONFIG_H
  75. )
  76. set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
  77. set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
  78. set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
  79. if( WITH_TEST )
  80. enable_testing()
  81. endif( WITH_TEST )
  82. ##### add apidox targets ############
  83. add_custom_target(apidox
  84. COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/doc/html"
  85. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  86. add_custom_target(install-apidox
  87. COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
  88. WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
  89. ##### tdegames directories #####################
  90. tde_conditional_add_subdirectory( BUILD_ATLANTIK atlantik )
  91. tde_conditional_add_subdirectory( BUILD_DOC doc )
  92. tde_conditional_add_subdirectory( BUILD_KASTEROIDS kasteroids )
  93. tde_conditional_add_subdirectory( BUILD_KATOMIC katomic )
  94. tde_conditional_add_subdirectory( BUILD_KBACKGAMMON kbackgammon )
  95. tde_conditional_add_subdirectory( BUILD_KBATTLESHIP kbattleship )
  96. tde_conditional_add_subdirectory( BUILD_KBLACKBOX kblackbox )
  97. tde_conditional_add_subdirectory( BUILD_KBOUNCE kbounce )
  98. tde_conditional_add_subdirectory( BUILD_KENOLABA kenolaba )
  99. tde_conditional_add_subdirectory( BUILD_KFOULEGGS kfouleggs )
  100. tde_conditional_add_subdirectory( BUILD_KGOLDRUNNER kgoldrunner )
  101. tde_conditional_add_subdirectory( BUILD_KJUMPINGCUBE kjumpingcube )
  102. tde_conditional_add_subdirectory( BUILD_KLICKETY klickety )
  103. tde_conditional_add_subdirectory( BUILD_KLINES klines )
  104. tde_conditional_add_subdirectory( BUILD_KMAHJONGG kmahjongg )
  105. tde_conditional_add_subdirectory( BUILD_KMINES kmines )
  106. tde_conditional_add_subdirectory( BUILD_KNETWALK knetwalk )
  107. tde_conditional_add_subdirectory( BUILD_KOLF kolf )
  108. tde_conditional_add_subdirectory( BUILD_KONQUEST konquest )
  109. tde_conditional_add_subdirectory( BUILD_KPAT kpat )
  110. tde_conditional_add_subdirectory( BUILD_KPOKER kpoker )
  111. tde_conditional_add_subdirectory( BUILD_KREVERSI kreversi )
  112. tde_conditional_add_subdirectory( BUILD_KSAME ksame )
  113. tde_conditional_add_subdirectory( BUILD_KSHISEN kshisen )
  114. tde_conditional_add_subdirectory( BUILD_KSIRTET ksirtet )
  115. tde_conditional_add_subdirectory( BUILD_KSMILETRIS ksmiletris )
  116. tde_conditional_add_subdirectory( BUILD_KSNAKE ksnake )
  117. tde_conditional_add_subdirectory( BUILD_KSOKOBAN ksokoban )
  118. tde_conditional_add_subdirectory( BUILD_KSPACEDUEL kspaceduel )
  119. tde_conditional_add_subdirectory( BUILD_KTRON ktron )
  120. tde_conditional_add_subdirectory( BUILD_KTUBERLING ktuberling )
  121. tde_conditional_add_subdirectory( BUILD_LIBTDEGAMES libtdegames )
  122. tde_conditional_add_subdirectory( BUILD_LSKAT lskat )
  123. tde_conditional_add_subdirectory( BUILD_TWIN4 twin4 )
  124. if( BUILD_KSIRTET OR BUILD_KFOULEGGS OR BUILD_KLICKETY )
  125. add_subdirectory( libksirtet )
  126. endif( )
  127. ##### write configure files #####################
  128. configure_file( config.h.cmake config.h @ONLY )