CMakeLists.txt 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  1. #
  2. # SuperTux - root build script
  3. # Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. #
  19. #
  20. # INSTRUCTIONS:
  21. # -------------
  22. #
  23. # Create a directory build/ and change to it. Run
  24. #
  25. # cmake ..
  26. #
  27. # This creates a set of Makefiles to build the project. Run
  28. #
  29. # make
  30. #
  31. ## Project name to use as command prefix.
  32. project(SUPERTUX)
  33. ### CMake configuration
  34. cmake_minimum_required(VERSION 3.1)
  35. if(COMMAND cmake_policy)
  36. cmake_policy(SET CMP0003 NEW)
  37. cmake_policy(SET CMP0008 NEW)
  38. cmake_policy(SET CMP0023 NEW)
  39. endif(COMMAND cmake_policy)
  40. set(CMAKE_CXX_STANDARD 14)
  41. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  42. set(CMAKE_CXX_EXTENSIONS OFF)
  43. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/mk/cmake)
  44. include(ConfigureFiles)
  45. include(ExternalProject)
  46. ## For autopackage
  47. set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2")
  48. set(BUILD_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data")
  49. set(BUILD_CONFIG_DATA_DIR "${CMAKE_BINARY_DIR}/data")
  50. ## Check endianess
  51. include(TestBigEndian)
  52. test_big_endian(WORDS_BIGENDIAN)
  53. ## Add definitions
  54. if(CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo")
  55. add_definitions(-DRELEASE)
  56. elseif(CMAKE_BUILD_TYPE MATCHES Debug)
  57. add_definitions(-DDEBUG)
  58. endif()
  59. set(SUPERTUX_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
  60. set(VCPKG_BUILD OFF CACHE BOOL "Use dependencies installed via vcpkg (not dependency package)")
  61. set(VCPKG_APPLOCAL_DEPS ${VCPKG_BUILD} BOOL)
  62. ## These variables enable MSVC to find libraries located in "dependencies{32|64}"
  63. if(WIN32)
  64. if(NOT VCPKG_BUILD)
  65. ## Store path of dependecy folder
  66. set(DEPENDENCY_FOLDER "${PROJECT_SOURCE_DIR}/dependencies")
  67. endif()
  68. ## To test if the host (not the build) is x64:
  69. ## "$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "AMD64"
  70. if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
  71. set(WIN64 ON)
  72. if(NOT VCPKG_BUILD)
  73. set(DEPENDENCY_FOLDER "${DEPENDENCY_FOLDER}64")
  74. endif()
  75. else(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
  76. set(WIN64 OFF)
  77. if(NOT VCPKG_BUILD)
  78. set(DEPENDENCY_FOLDER "${DEPENDENCY_FOLDER}32")
  79. endif()
  80. endif(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
  81. if(WIN64)
  82. set(SUPERTUX_SYSTEM_NAME win64)
  83. else(WIN64)
  84. set(SUPERTUX_SYSTEM_NAME win32)
  85. endif(WIN64)
  86. if(NOT VCPKG_BUILD)
  87. set(ENV{PATH} "$ENV{PATH};${DEPENDENCY_FOLDER}/include")
  88. set(ENV{LIB} "${DEPENDENCY_FOLDER}/lib")
  89. set(ENV{OPENALDIR} "${DEPENDENCY_FOLDER}")
  90. endif()
  91. ## Enable multi-processor compilation (faster)
  92. if(MSVC)
  93. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
  94. endif(MSVC)
  95. ## And shut up about unsafe stuff
  96. add_definitions(-D_CRT_SECURE_NO_WARNINGS)
  97. ## Add an icon
  98. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/icon_rc.template" "${PROJECT_BINARY_DIR}/tmp/icon.rc")
  99. ## Find all used libraries
  100. if(NOT VCPKG_BUILD)
  101. file(GLOB DLLS "${DEPENDENCY_FOLDER}/dll/*")
  102. endif()
  103. endif(WIN32)
  104. ## Add lots of dependencies to compiler switches
  105. set(Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0")
  106. if(WIN32)
  107. option(ENABLE_BOOST_STATIC_LIBS "Use boost static libraries" ON)
  108. else(WIN32)
  109. option(ENABLE_BOOST_STATIC_LIBS "Use boost static libraries" OFF)
  110. endif(WIN32)
  111. if(ENABLE_BOOST_STATIC_LIBS)
  112. set(Boost_USE_STATIC_LIBS TRUE)
  113. else(ENABLE_BOOST_STATIC_LIBS)
  114. set(Boost_USE_STATIC_LIBS FALSE)
  115. endif(ENABLE_BOOST_STATIC_LIBS)
  116. find_package(Boost REQUIRED COMPONENTS filesystem system date_time locale)
  117. include_directories(SYSTEM ${Boost_INCLUDE_DIR})
  118. link_directories(${Boost_LIBRARY_DIRS})
  119. find_package(PNG REQUIRED)
  120. if(WIN32)
  121. if(VCPKG_BUILD)
  122. find_package(SDL2 CONFIG REQUIRED)
  123. find_path(SDL2_INCLUDE_DIRS SDL2/SDL.h)
  124. find_path(SDL2IMAGE_INCLUDE_DIRS SDL2/SDL_image.h)
  125. set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS}/SDL2)
  126. set(SDL2IMAGE_INCLUDE_DIRS ${SDL2IMAGE_INCLUDE_DIRS}/SDL2)
  127. find_library(SDL2_LIBRARIES SDL2)
  128. find_library(SDL2IMAGE_LIBRARIES SDL2_image)
  129. find_library(SDL2MAIN_LIBRARIES SDL2main)
  130. message(STATUS "SDL2_INCLUDE_DIR is ${SDL2_INCLUDE_DIRS}")
  131. else(VCPKG_BUILD)
  132. find_path(SDL2_INCLUDE_DIRS NAMES SDL.h PATHS "${DEPENDENCY_FOLDER}/include/SDL2")
  133. find_path(SDL2IMAGE_INCLUDE_DIRS NAMES SDL_image.h PATHS "${DEPENDENCY_FOLDER}/include/SDL2_image")
  134. find_library(SDL2_LIBRARIES NAMES SDL2 PATHS "${DEPENDENCY_FOLDER}/lib")
  135. find_library(SDL2IMAGE_LIBRARIES NAMES SDL2_image PATHS "${DEPENDENCY_FOLDER}/lib")
  136. find_library(SDL2MAIN_LIBRARIES NAMES SDL2main PATHS "${DEPENDENCY_FOLDER}/lib")
  137. find_path(PHYSFS_INCLUDE_DIR NAMES physfs.h PATHS "${DEPENDENCY_FOLDER}/include/physfs")
  138. endif(VCPKG_BUILD)
  139. else(WIN32)
  140. include(FindPkgConfig)
  141. pkg_search_module(SDL2 REQUIRED sdl2>=2.0.1)
  142. pkg_search_module(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)
  143. endif(WIN32)
  144. set(HAVE_SDL TRUE)
  145. option(IS_SUPERTUX_RELEASE "Build as official SuperTux release" OFF)
  146. option(BUILD_TESTS "Build test cases" OFF)
  147. option(ENABLE_OPENGL "Enable OpenGL support" ON)
  148. option(ENABLE_OPENGLES2 "Enable OpenGLES2 support" OFF)
  149. option(GLBINDING_ENABLED "Use glbinding instead of GLEW" OFF)
  150. option(GLBINDING_DEBUG_OUTPUT "Enable glbinding debug output for each called OpenGL function" OFF)
  151. if(ENABLE_OPENGL)
  152. if(ENABLE_OPENGLES2)
  153. pkg_check_modules(GLESV2 REQUIRED glesv2)
  154. set(HAVE_OPENGL TRUE)
  155. set(OPENGL_INCLUDE_DIR ${GLESV2_INCLUDE_DIRS})
  156. set(OPENGL_LIBRARY ${GLESV2_LIBRARIES})
  157. add_definitions(-DUSE_OPENGLES2)
  158. else()
  159. set(OpenGL_GL_PREFERENCE "LEGACY")
  160. find_package(OpenGL)
  161. if(OPENGL_FOUND)
  162. include_directories(SYSTEM ${OPENGL_INCLUDE_DIR})
  163. set(HAVE_OPENGL TRUE)
  164. endif(OPENGL_FOUND)
  165. if(GLBINDING_ENABLED)
  166. find_package(GLBINDING REQUIRED)
  167. if(GLBINDING_FOUND)
  168. include_directories(SYSTEM ${GLBINDING_INCLUDES})
  169. add_definitions(-DUSE_GLBINDING)
  170. IF (GLBINDING_DEBUG_OUTPUT)
  171. add_definitions(-DUSE_GLBINDING_DEBUG_OUTPUT)
  172. endif()
  173. endif()
  174. else()
  175. find_package(GLEW REQUIRED)
  176. if(GLEW_FOUND)
  177. include_directories(SYSTEM ${GLEW_INCLUDE_DIR})
  178. endif(GLEW_FOUND)
  179. endif()
  180. endif()
  181. endif(ENABLE_OPENGL)
  182. if(VCPKG_BUILD)
  183. find_package(OpenAL CONFIG REQUIRED)
  184. else()
  185. find_package(OpenAL REQUIRED)
  186. endif()
  187. include_directories(SYSTEM ${OPENAL_INCLUDE_DIR})
  188. find_package(OggVorbis REQUIRED)
  189. include_directories(SYSTEM ${VORBIS_INCLUDE_DIR})
  190. include(CheckSymbolExists)
  191. find_package(PhysFS)
  192. if(PHYSFS_LIBRARY)
  193. set(CMAKE_REQUIRED_LIBRARIES ${PHYSFS_LIBRARY})
  194. check_symbol_exists("PHYSFS_getPrefDir" "${PHYSFS_INCLUDE_DIR}/physfs.h" HAVE_PHYSFS_GETPREFDIR)
  195. endif()
  196. if(HAVE_PHYSFS_GETPREFDIR)
  197. set(USE_SYSTEM_PHYSFS ON CACHE BOOL "Use preinstalled physfs (must support getPrefDir)")
  198. else(HAVE_PHYSFS_GETPREFDIR)
  199. set(USE_SYSTEM_PHYSFS OFF CACHE BOOL "Use preinstalled physfs (must support getPrefDir)")
  200. endif(HAVE_PHYSFS_GETPREFDIR)
  201. if(NOT USE_SYSTEM_PHYSFS)
  202. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt)
  203. message(FATAL_ERROR "physfs submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt is missing")
  204. endif()
  205. if(WIN32)
  206. set(PHYSFS_BUILD_SHARED TRUE)
  207. set(PHYSFS_BUILD_STATIC FALSE)
  208. else(WIN32)
  209. set(PHYSFS_BUILD_SHARED FALSE)
  210. set(PHYSFS_BUILD_STATIC TRUE)
  211. endif()
  212. set(PHYSFS_PREFIX ${CMAKE_BINARY_DIR}/physfs/)
  213. ExternalProject_Add(physfs
  214. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/physfs/"
  215. CMAKE_ARGS
  216. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  217. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  218. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  219. -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  220. -DCMAKE_INSTALL_PREFIX=${PHYSFS_PREFIX}
  221. -DLIB_SUFFIX=${LIB_SUFFIX}
  222. -DPHYSFS_BUILD_SHARED=${PHYSFS_BUILD_SHARED}
  223. -DPHYSFS_BUILD_STATIC=${PHYSFS_BUILD_STATIC}
  224. -DPHYSFS_BUILD_TEST=FALSE)
  225. if(WIN32)
  226. add_library(physfs_lib SHARED IMPORTED)
  227. set_target_properties(physfs_lib PROPERTIES IMPORTED_LOCATION "${PHYSFS_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}physfs${CMAKE_SHARED_LIBRARY_SUFFIX}")
  228. set_target_properties(physfs_lib PROPERTIES IMPORTED_IMPLIB "${PHYSFS_PREFIX}/lib${LIB_SUFFIX}/physfs${CMAKE_LINK_LIBRARY_SUFFIX}")
  229. else()
  230. add_library(physfs_lib STATIC IMPORTED)
  231. set_target_properties(physfs_lib PROPERTIES IMPORTED_LOCATION "${PHYSFS_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}physfs${CMAKE_STATIC_LIBRARY_SUFFIX}")
  232. endif()
  233. set(PHYSFS_INCLUDE_DIR "${PHYSFS_PREFIX}/include/")
  234. endif()
  235. include_directories(BEFORE SYSTEM ${PHYSFS_INCLUDE_DIR})
  236. ## The curl headers are in the standard include path in dependencies
  237. ## so it's not required to add them here
  238. find_package(CURL REQUIRED)
  239. if(WIN32 AND VCPKG_BUILD)
  240. list(LENGTH CURL_LIBRARY CURL_LIBRARY_LENGTH)
  241. if (CURL_LIBRARY_LENGTH EQUAL 1)
  242. set(CURL_LIBRARY_DEBUG_LIB ${CURL_LIBRARY})
  243. set(CURL_LIBRARY_RELEASE_LIB ${CURL_LIBRARY_DEBUG_LIB}/../../../lib/libcurl.lib)
  244. get_filename_component(CURL_LIBRARY_RELEASE_LIB ${CURL_LIBRARY_RELEASE_LIB} REALPATH)
  245. unset(CURL_LIBRARY CACHE)
  246. unset(CURL_LIBRARY)
  247. unset(CURL_LIBRARIES CACHE)
  248. unset(CURL_LIBRARIES)
  249. set(CURL_LIBRARY "debug;${CURL_LIBRARY_DEBUG_LIB};optimized;${CURL_LIBRARY_RELEASE_LIB}")
  250. set(CURL_LIBRARIES ${CURL_LIBRARY})
  251. endif()
  252. endif()
  253. if(CURL_FOUND)
  254. include_directories(SYSTEM ${CURL_INCLUDE_DIR})
  255. set(HAVE_LIBCURL TRUE)
  256. endif(CURL_FOUND)
  257. #find_package(ICONV REQUIRED)
  258. #include_directories(SYSTEM ${ICONV_INCLUDE_DIR})
  259. #link_libraries(${ICONV_LIBRARY})
  260. if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  261. ## Find revision of WC
  262. mark_as_advanced(GIT_EXECUTABLE)
  263. find_program(GIT_EXECUTABLE git)
  264. if(NOT GIT_EXECUTABLE EQUAL "GIT_EXECUTABLE-NOTFOUND")
  265. include(GetGitRevisionDescription)
  266. git_describe(VERSION_STRING_GIT "--tags" "--match" "?[0-9]*.[0-9]*.[0-9]*")
  267. string(REPLACE "v" "" VERSION_LIST ${VERSION_STRING_GIT})
  268. string(REGEX REPLACE "(-|_|\\.)" ";" VERSION_LIST ";${VERSION_LIST}")
  269. endif()
  270. endif(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  271. get_filename_component(BASEDIR ${CMAKE_SOURCE_DIR} NAME)
  272. if("${VERSION_LIST}" STREQUAL "")
  273. if(${BASEDIR} MATCHES "supertux2-[0-9\\.]*")
  274. string(REGEX REPLACE "(\\.|_|-)" ";" VERSION_LIST ${BASEDIR})
  275. endif()
  276. endif()
  277. file(GLOB ORIG_TGZ ../*.orig.tar.gz)
  278. if("${VERSION_LIST}" STREQUAL "" AND (NOT "${ORIG_TGZ}" STREQUAL ""))
  279. get_filename_component(BASEDIR ${ORIG_TGZ} NAME)
  280. string(REGEX REPLACE "(\\.|_|-)" ";" VERSION_LIST ${BASEDIR})
  281. endif()
  282. list(LENGTH VERSION_LIST VERSION_LIST_SIZE)
  283. if(${VERSION_LIST_SIZE} GREATER 0)
  284. list(GET VERSION_LIST 1 MAJOR_VERSION_GIT)
  285. list(GET VERSION_LIST 2 MINOR_VERSION_GIT)
  286. list(GET VERSION_LIST 3 PATCH_VERSION_GIT)
  287. if("${VERSION_STRING_GIT}" STREQUAL "")
  288. set(VERSION_STRING_GIT "${MAJOR_VERSION_GIT}.${MINOR_VERSION_GIT}.${PATCH_VERSION_GIT}")
  289. endif()
  290. configure_file("${CMAKE_SOURCE_DIR}/version.cmake.in" "${CMAKE_SOURCE_DIR}/version.cmake")
  291. endif()
  292. if(NOT EXISTS "${CMAKE_SOURCE_DIR}/version.cmake")
  293. message( SEND_ERROR "Cound not find GIT or valid version.cmake. Version information will be invalid." )
  294. endif(NOT EXISTS "${CMAKE_SOURCE_DIR}/version.cmake")
  295. include("${CMAKE_SOURCE_DIR}/version.cmake")
  296. set(SUPERTUX_VERSION ${SUPERTUX_VERSION_STRING})
  297. configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h )
  298. set_source_files_properties(${CMAKE_BINARY_DIR}/version.h
  299. PROPERTIES GENERATED true)
  300. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/main.cpp
  301. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  302. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/title_screen.cpp
  303. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  304. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/addon/addon_manager.cpp
  305. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  306. ## Configure doxygen
  307. # Adapted from https://tty1.net/blog/2014/cmake-doxygen_en.html
  308. # add a target to generate API documentation with Doxygen
  309. find_package(Doxygen)
  310. option(BUILD_DOCUMENTATION "Build API documentation using Doxygen" ${DOXYGEN_FOUND})
  311. if(BUILD_DOCUMENTATION)
  312. if(NOT DOXYGEN_FOUND)
  313. message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  314. endif()
  315. set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
  316. set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile)
  317. configure_file(${doxyfile_in} ${doxyfile} @ONLY)
  318. add_custom_target(doc
  319. COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
  320. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  321. COMMENT "Generating API documentation with Doxygen"
  322. VERBATIM)
  323. endif()
  324. ## Check platform-dependent build options
  325. include(ConfigureChecks)
  326. # Include altivec wrapper on ppc
  327. if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
  328. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
  329. endif()
  330. ## Also build external/squirrel
  331. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt)
  332. message(FATAL_ERROR "squirrel submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt is missing")
  333. endif()
  334. set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/squirrel/ex)
  335. ExternalProject_Add(squirrel
  336. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/squirrel/"
  337. CMAKE_ARGS
  338. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  339. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  340. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  341. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  342. -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  343. -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
  344. -DINSTALL_INC_DIR=include)
  345. if(WIN32)
  346. add_library(squirrel_lib SHARED IMPORTED)
  347. set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}squirrel${CMAKE_SHARED_LIBRARY_SUFFIX}")
  348. set_target_properties(squirrel_lib PROPERTIES IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/squirrel${CMAKE_LINK_LIBRARY_SUFFIX}")
  349. add_library(sqstdlib_lib SHARED IMPORTED)
  350. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}")
  351. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/sqstdlib${CMAKE_LINK_LIBRARY_SUFFIX}")
  352. #For debug run purposes
  353. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${PROJECT_BINARY_DIR}/run_supertux.bat")
  354. else()
  355. add_library(squirrel_lib STATIC IMPORTED)
  356. set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
  357. add_library(sqstdlib_lib STATIC IMPORTED)
  358. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
  359. endif()
  360. include_directories(SYSTEM ${SQUIRREL_PREFIX}/include)
  361. ## Also build external/tinygettext
  362. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt)
  363. message(FATAL_ERROR "tinygettext submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt is missing")
  364. endif()
  365. # Include altivec wrapper on ppc
  366. if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
  367. set(TINYGETTEXT_CXX_FLAGS "-isystem ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc ${CMAKE_CXX_FLAGS}")
  368. else()
  369. set(TINYGETTEXT_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  370. endif()
  371. set(TINYGETTEXT_PREFIX ${CMAKE_BINARY_DIR}/tinygettext/)
  372. ExternalProject_Add(tinygettext
  373. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/tinygettext/"
  374. CMAKE_ARGS
  375. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  376. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  377. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  378. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  379. -DCMAKE_CXX_FLAGS=${TINYGETTEXT_CXX_FLAGS}
  380. -DBUILD_SHARED_LIBS=OFF
  381. -DHAVE_SDL=ON
  382. -DVCPKG_BUILD=${VCPKG_BUILD}
  383. -DCMAKE_INSTALL_PREFIX=${TINYGETTEXT_PREFIX}
  384. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  385. -DSDL2_LIBRARIES=${SDL2_LIBRARIES}
  386. -DSDL2_INCLUDE_DIRS=${SDL2_INCLUDE_DIRS}
  387. -DLIB_SUFFIX=${LIB_SUFFIX})
  388. add_library(tinygettext_lib STATIC IMPORTED)
  389. set_target_properties(tinygettext_lib PROPERTIES IMPORTED_LOCATION "${TINYGETTEXT_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}tinygettext${CMAKE_STATIC_LIBRARY_SUFFIX}")
  390. include_directories(SYSTEM ${TINYGETTEXT_PREFIX}/include)
  391. ## external/SDL_ttf with patches
  392. find_package(Freetype REQUIRED)
  393. find_package(RAQM)
  394. set(SDL_TTF_PREFIX ${CMAKE_BINARY_DIR}/SDL_ttf/)
  395. ExternalProject_Add(SDL_ttf
  396. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/SDL_ttf/"
  397. CMAKE_ARGS
  398. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  399. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  400. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  401. -DCMAKE_INSTALL_PREFIX=${SDL_TTF_PREFIX}
  402. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  403. -DWITH_RAQM=${RAQM_FOUND}
  404. -DRAQM_LIBRARIES=${RAQM_LIBRARY}
  405. -DRAQM_INCLUDE_DIR=${RAQM_INCLUDE_DIR}
  406. -DBUILD_SHARED_LIBS=OFF)
  407. add_library(SDL_ttf_lib STATIC IMPORTED)
  408. set_target_properties(SDL_ttf_lib PROPERTIES IMPORTED_LOCATION "${SDL_TTF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_ttf${CMAKE_STATIC_LIBRARY_SUFFIX}")
  409. link_directories(${SDL_TTF_PREFIX}/lib)
  410. include_directories(SYSTEM ${SDL_TTF_PREFIX}/include/SDL2)
  411. if(RAQM_FOUND)
  412. find_package(Fribidi REQUIRED)
  413. find_package(Harfbuzz REQUIRED)
  414. set_target_properties(SDL_ttf_lib PROPERTIES INTERFACE_LINK_LIBRARIES "${RAQM_LIBRARIES}")
  415. endif()
  416. ## Some additional include paths
  417. include_directories(${CMAKE_BINARY_DIR}/)
  418. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
  419. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/findlocale/)
  420. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/obstack/)
  421. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/include/)
  422. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/SDL_SavePNG/)
  423. if(WIN32)
  424. add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX)
  425. add_definitions(-DWIN32)
  426. endif(WIN32)
  427. ## Lint
  428. if(CMAKE_VERSION VERSION_GREATER 3.6)
  429. if (USE_CLANG_TIDY)
  430. find_program(
  431. CLANG_TIDY_EXE
  432. NAMES "clang-tidy"
  433. DOC "Path to clang-tidy executable"
  434. )
  435. if(NOT CLANG_TIDY_EXE)
  436. message(FATAL_ERROR "clang-tidy not found.")
  437. else()
  438. message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
  439. set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
  440. endif()
  441. endif()
  442. endif()
  443. ## Build list of sources for supertux binary
  444. file(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
  445. file(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp src/video/null/*.cpp)
  446. file(GLOB SUPERTUX_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_BINARY_DIR}/tmp/*.rc")
  447. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt)
  448. message(FATAL_ERROR "sexp-cpp submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt is missing")
  449. endif()
  450. file(GLOB SEXP_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/sexp-cpp/src/*.cpp)
  451. add_library(sexp STATIC ${SEXP_SOURCES_CXX})
  452. target_compile_definitions(sexp PRIVATE -DSEXP_USE_LOCALE)
  453. file(GLOB SAVEPNG_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/SDL_SavePNG/savepng.c)
  454. add_library(savepng STATIC ${SAVEPNG_SOURCES_CXX})
  455. target_include_directories(savepng SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS})
  456. target_link_libraries(savepng PUBLIC ${PNG_LIBRARIES})
  457. if(HAVE_OPENGL)
  458. file(GLOB SUPERTUX_OPENGL_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/video/gl/*.cpp)
  459. set(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_OPENGL_SOURCES})
  460. endif(HAVE_OPENGL)
  461. ## Sort source lists to have deterministic linking order
  462. list(SORT SUPERTUX_SOURCES_C)
  463. list(SORT SUPERTUX_SOURCES_CXX)
  464. list(SORT SUPERTUX_RESOURCES)
  465. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  466. set(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  467. endif(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  468. ## Compile everything at once (roughly equivalent to cat *.cpp | gcc)
  469. option(COMPILE_AMALGATION "Compile all the files together at once (experimental)" OFF)
  470. if(COMPILE_AMALGATION)
  471. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "// Includes all source files of the project\n")
  472. foreach(ST_FILE ${SUPERTUX_SOURCES_CXX})
  473. file(RELATIVE_PATH CXX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src "${CMAKE_CURRENT_SOURCE_DIR}/${ST_FILE}")
  474. file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "#include \"${CXX_FILE}\"\n")
  475. endforeach(ST_FILE)
  476. ## Build instead of CXX sources
  477. set(SUPERTUX_SOURCES_CXX ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  478. else(COMPILE_AMALGATION)
  479. if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  480. file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  481. endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  482. endif(COMPILE_AMALGATION)
  483. ## Debug options
  484. option(WERROR "Stop on first compiler warning" OFF)
  485. option(WARNINGS "Enable long list of warnings for compiler to check" OFF)
  486. option(USE_CLANG_TIDY "Run clang-tidy" OFF)
  487. if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  488. set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
  489. set(CMAKE_C_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
  490. set(CMAKE_CXX_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
  491. set(CMAKE_C_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
  492. set(CMAKE_LD_FLAGS_PROFILE "-lgmon" CACHE STRING "Profile flags")
  493. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -funit-at-a-time")
  494. if(WERROR)
  495. add_definitions(-Werror)
  496. else(WERROR)
  497. remove_definitions(-Werror)
  498. endif(WERROR)
  499. if(WARNINGS)
  500. # temporarily disabled:
  501. # -Wsign-conversion -Wfloat-equal -Wundef -Wswitch-default
  502. # -Wswitch-enum -Wsign-promo -Wcast-qual -Woverloaded-virtual -Wmissing-format-attribute
  503. # -Wpadded -Wabi -Winline -Wunsafe-loop-optimizations -Wstrict-overflow=5
  504. # fails on MinGW:
  505. # -ansi
  506. if(CMAKE_COMPILER_IS_GNUCXX)
  507. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  508. "-fdiagnostics-show-option "
  509. "-pedantic "
  510. "-Wno-long-long "
  511. "-Wcast-align "
  512. "-Wdisabled-optimization "
  513. "-Winit-self -Winvalid-pch "
  514. "-Wmissing-include-dirs "
  515. "-Wmissing-noreturn "
  516. "-Wpacked -Wredundant-decls "
  517. "-Wformat=2 "
  518. "-Weffc++ "
  519. "-Wctor-dtor-privacy "
  520. "-Wno-unused-parameter "
  521. "-Wshadow "
  522. "-Wnon-virtual-dtor "
  523. "-Wcast-qual "
  524. "-Wold-style-cast "
  525. "-Wzero-as-null-pointer-constant "
  526. "-Wconversion "
  527. "-Wlogical-op "
  528. "-Wstrict-null-sentinel "
  529. "-Wsuggest-override "
  530. )
  531. if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8)
  532. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  533. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  534. "-Wint-in-bool-context "
  535. )
  536. endif()
  537. if(Boost_VERSION LESS 106500)
  538. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  539. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  540. "-Wno-implicit-fallthrough ")
  541. endif()
  542. elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  543. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  544. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  545. "-Weverything "
  546. # flags that we deliberately ignore
  547. "-Wno-c++98-compat "
  548. "-Wno-c++98-compat-pedantic "
  549. "-Wno-float-equal "
  550. "-Wno-padded "
  551. "-Wno-weak-vtables "
  552. "-Wno-disabled-macro-expansion "
  553. "-Wno-documentation "
  554. "-Wno-reserved-id-macro "
  555. "-Wno-sign-conversion "
  556. # warnings that should probably be fixed in code
  557. "-Wno-documentation-unknown-command "
  558. "-Wno-inconsistent-missing-destructor-override "
  559. "-Wno-deprecated-dynamic-exception-spec "
  560. "-Wno-deprecated "
  561. "-Wno-switch-enum "
  562. "-Wno-covered-switch-default "
  563. "-Wno-exit-time-destructors "
  564. "-Wno-global-constructors "
  565. "-Wno-duplicate-enum "
  566. "-Wno-unreachable-code "
  567. )
  568. endif()
  569. endif(WARNINGS)
  570. endif()
  571. ## If xgettext is available, generate messages.pot for sources
  572. option(GENERATE_MESSAGESPOT "Generate messages.pot files" OFF)
  573. if(GENERATE_MESSAGESPOT)
  574. mark_as_advanced(
  575. XGETTEXT_EXECUTABLE
  576. )
  577. find_program(XGETTEXT_EXECUTABLE xgettext)
  578. if(NOT XGETTEXT_EXECUTABLE)
  579. message(STATUS "Warning: xgettext not found - will not update messages.pot")
  580. else(NOT XGETTEXT_EXECUTABLE)
  581. message(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
  582. set(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/data/locale/messages.pot)
  583. add_custom_command(
  584. OUTPUT ${MESSAGES_POT_FILE}
  585. COMMAND ${XGETTEXT_EXECUTABLE}
  586. ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES_CXX}
  587. DEPENDS ${SUPERTUX_SOURCES_CXX}
  588. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  589. COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
  590. )
  591. list(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
  592. file(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} data/levels/*)
  593. foreach(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS})
  594. file(GLOB SUPERTUX_LEVELS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt)
  595. ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4
  596. if(SUPERTUX_LEVELS)
  597. set(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot)
  598. add_custom_command(
  599. OUTPUT ${MESSAGES_POT_FILE}
  600. COMMAND ${XGETTEXT_EXECUTABLE}
  601. ARGS --keyword="_:1" --language=Lisp --force-po --sort-by-file "--output=${MESSAGES_POT_FILE}" ${SUPERTUX_LEVELS}
  602. DEPENDS ${SUPERTUX_LEVELS}
  603. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  604. COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
  605. )
  606. list(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
  607. endif(SUPERTUX_LEVELS)
  608. endforeach(SUPERTUX_LEVEL_DIR)
  609. add_custom_target(
  610. supertux2-messages ALL
  611. DEPENDS ${MESSAGES_POT_FILES}
  612. )
  613. endif(NOT XGETTEXT_EXECUTABLE)
  614. endif(GENERATE_MESSAGESPOT)
  615. ## Some additional compiler switches
  616. if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  617. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
  618. endif()
  619. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  620. add_definitions(-DMACOSX)
  621. endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  622. ## On Windows, add an icon
  623. if(WIN32)
  624. # set(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
  625. if(MINGW)
  626. add_custom_command(
  627. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o
  628. COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons -i${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc -o ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
  629. set(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
  630. endif(MINGW)
  631. endif(WIN32)
  632. ## Build miniswig and generate miniswig wrapper
  633. option(GENERATE_WRAPPER "Build miniswig and generate the wrapper" OFF)
  634. if(GENERATE_WRAPPER)
  635. add_subdirectory(tools/miniswig)
  636. add_custom_command(
  637. OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp
  638. COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_CXX_COMPILER}
  639. ARGS -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o ${CMAKE_CURRENT_BINARY_DIR}/miniswig.tmp -I${CMAKE_CURRENT_SOURCE_DIR}/src
  640. COMMAND tools/miniswig/miniswig
  641. ARGS --input miniswig.tmp --output-cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp --output-hpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp --module supertux --select-namespace scripting
  642. DEPENDS tools/miniswig/miniswig
  643. IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.interface.hpp
  644. )
  645. if(USE_CLANG_TIDY)
  646. set_target_properties(miniswig PROPERTIES CXX_CLANG_TIDY "")
  647. endif()
  648. endif(GENERATE_WRAPPER)
  649. ## Generate supertux executable in the right place
  650. #set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
  651. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  652. ## Add target for supertux binary
  653. add_library(supertux2_c OBJECT ${SUPERTUX_SOURCES_C})
  654. add_library(supertux2_lib STATIC ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
  655. if(WIN32)
  656. add_executable(supertux2 WIN32 src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
  657. target_link_libraries(supertux2 ${SDL2MAIN_LIBRARIES})
  658. else()
  659. add_executable(supertux2 src/main.cpp)
  660. endif(WIN32)
  661. target_link_libraries(supertux2 supertux2_lib Boost::filesystem Boost::locale)
  662. set_target_properties(supertux2_lib PROPERTIES OUTPUT_NAME supertux2_lib)
  663. set_target_properties(supertux2_lib PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS}")
  664. if(WIN32 AND NOT VCPKG_BUILD)
  665. ## Copy dlls on windows
  666. add_custom_command(TARGET supertux2_lib POST_BUILD
  667. COMMAND ${CMAKE_COMMAND} -E copy_directory
  668. "${DEPENDENCY_FOLDER}/dll"
  669. $<TARGET_FILE_DIR:supertux2_lib>)
  670. endif(WIN32 AND NOT VCPKG_BUILD)
  671. ## Link supertux binary with squirrel and other libraries
  672. add_dependencies(supertux2_lib tinygettext)
  673. add_dependencies(supertux2_lib squirrel)
  674. add_dependencies(supertux2_lib SDL_ttf)
  675. if(VCPKG_BUILD)
  676. target_include_directories(supertux2_lib PUBLIC ${CURL_INCLUDE_DIRS})
  677. endif()
  678. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS})
  679. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL2IMAGE_INCLUDE_DIRS})
  680. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL_TTF_PREFIX}/include/SDL2)
  681. if(VCPKG_BUILD)
  682. target_link_libraries(supertux2_lib PRIVATE SDL2::SDL2main SDL2::SDL2 SDL2_image)
  683. else()
  684. target_link_libraries(supertux2_lib PUBLIC ${SDL2_LIBRARIES})
  685. target_link_libraries(supertux2_lib PUBLIC ${SDL2IMAGE_LIBRARIES})
  686. endif()
  687. target_link_libraries(supertux2_lib PUBLIC SDL_ttf_lib)
  688. target_link_libraries(supertux2_lib PUBLIC ${FREETYPE_LIBRARIES})
  689. if(RAQM_FOUND)
  690. target_link_libraries(supertux2_lib PUBLIC ${HARFBUZZ_LIBRARY} ${FRIBIDI_LIBRARY} ${RAQM_LIBRARY})
  691. endif()
  692. target_link_libraries(supertux2_lib PUBLIC squirrel_lib)
  693. target_link_libraries(supertux2_lib PUBLIC sqstdlib_lib)
  694. target_link_libraries(supertux2_lib PUBLIC tinygettext_lib)
  695. target_link_libraries(supertux2_lib PUBLIC sexp)
  696. target_link_libraries(supertux2_lib PUBLIC savepng)
  697. if(VCPKG_BUILD)
  698. target_link_libraries(supertux2_lib PUBLIC OpenAL::OpenAL)
  699. else()
  700. target_link_libraries(supertux2_lib PUBLIC ${OPENAL_LIBRARY})
  701. endif()
  702. target_link_libraries(supertux2_lib PUBLIC ${OGGVORBIS_LIBRARIES})
  703. target_link_libraries(supertux2_lib PUBLIC ${Boost_LIBRARIES})
  704. if(USE_SYSTEM_PHYSFS)
  705. target_link_libraries(supertux2_lib PUBLIC ${PHYSFS_LIBRARY})
  706. else()
  707. add_dependencies(supertux2_lib physfs)
  708. target_link_libraries(supertux2_lib PUBLIC physfs_lib)
  709. if(APPLE)
  710. target_link_libraries(supertux2_lib PUBLIC "-framework CoreFoundation")
  711. target_link_libraries(supertux2_lib PUBLIC "-framework Foundation")
  712. target_link_libraries(supertux2_lib PUBLIC "-framework IOKit")
  713. endif()
  714. endif()
  715. if(HAVE_OPENGL)
  716. target_link_libraries(supertux2_lib PUBLIC ${OPENGL_LIBRARY})
  717. if(NOT ENABLE_OPENGLES2)
  718. if(GLBINDING_FOUND)
  719. target_link_libraries(supertux2_lib PUBLIC ${GLBINDING_LIBRARIES})
  720. else()
  721. target_link_libraries(supertux2_lib PUBLIC GLEW::GLEW)
  722. endif()
  723. endif()
  724. endif(HAVE_OPENGL)
  725. if(HAVE_LIBCURL)
  726. if(VCPKG_BUILD)
  727. target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
  728. else()
  729. target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY})
  730. endif()
  731. endif(HAVE_LIBCURL)
  732. if(BUILD_TESTS)
  733. find_package(Threads REQUIRED)
  734. # build gtest
  735. # ${CMAKE_CURRENT_SOURCE_DIR} in include_directories is needed to generate -isystem instead of -I flags
  736. add_library(gtest_main STATIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/src/gtest_main.cc)
  737. target_include_directories(gtest_main SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/include/)
  738. add_library(gtest STATIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/src/gtest-all.cc)
  739. target_include_directories(gtest SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/)
  740. target_include_directories(gtest SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/include/)
  741. # build SuperTux tests
  742. file(GLOB TEST_SUPERTUX_SOURCES tests/*.cpp)
  743. add_executable(test_supertux2 ${TEST_SUPERTUX_SOURCES})
  744. target_compile_options(test_supertux2 PRIVATE ${WARNINGS_CXX_FLAGS})
  745. target_link_libraries(test_supertux2
  746. gtest gtest_main
  747. supertux2_lib
  748. ${CMAKE_THREAD_LIBS_INIT})
  749. # add 'make test' target, use 'make test ARGS="-V"' or 'ctest -V' for verbose
  750. enable_testing()
  751. add_test(NAME test_supertux2
  752. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  753. COMMAND test_supertux2)
  754. endif()
  755. ## Install stuff
  756. option(DISABLE_CPACK_BUNDLING "Build an .app bundle without CPack" OFF)
  757. if(WIN32 AND NOT UNIX)
  758. set(INSTALL_SUBDIR_BIN "bin" CACHE STRING "Installation subdir for binaries")
  759. set(INSTALL_SUBDIR_SHARE "data" CACHE STRING "Installation subdir for data")
  760. set(INSTALL_SUBDIR_DOC "doc" CACHE STRING "Installation subdir for docs")
  761. if(VCPKG_BUILD)
  762. install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/" DESTINATION ${INSTALL_SUBDIR_BIN} FILES_MATCHING PATTERN "*.dll")
  763. else()
  764. install(FILES ${DLLS} DESTINATION ${INSTALL_SUBDIR_BIN})
  765. endif()
  766. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".")
  767. option(PACKAGE_VCREDIST "Package the VCREDIST libraries with the program" OFF)
  768. if(PACKAGE_VCREDIST)
  769. set(CMAKE_INSTALL_UCRT_LIBRARIES true)
  770. include(InstallRequiredSystemLibraries)
  771. endif()
  772. else(WIN32 AND NOT UNIX)
  773. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  774. set(INFOPLIST_CFBUNDLEEXECUTABLE "supertux2")
  775. set(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS" CACHE STRING "Installation subdir for binaries")
  776. set(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data" CACHE STRING "Installation subdir for data")
  777. set(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources" CACHE STRING "Installation subdir for docs")
  778. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist.in ${CMAKE_BINARY_DIR}/tools/darwin/info.plist)
  779. install(FILES ${CMAKE_BINARY_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
  780. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/receipt DESTINATION "SuperTux.app/Contents/_MASReceipt/")
  781. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.icns DESTINATION "SuperTux.app/Contents/Resources/")
  782. else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  783. set(INSTALL_SUBDIR_BIN "games" CACHE STRING "Installation subdir for binaries")
  784. set(INSTALL_SUBDIR_SHARE "share/games/supertux2" CACHE STRING "Installation subdir for data")
  785. set(INSTALL_SUBDIR_DOC "share/doc/supertux2" CACHE STRING "Installation subdir for docs")
  786. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
  787. set(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR_BIN}/supertux2")
  788. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION "share/pixmaps/")
  789. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.svg DESTINATION "share/icons/hicolor/scalable/apps")
  790. endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  791. endif(WIN32 AND NOT UNIX)
  792. install(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN})
  793. if(WIN32)
  794. get_property(SQUIRREL_LIB_PATH TARGET squirrel_lib PROPERTY IMPORTED_LOCATION)
  795. get_property(SQSTDLIB_LIB_PATH TARGET sqstdlib_lib PROPERTY IMPORTED_LOCATION)
  796. get_property(PHYSFS_LIB_PATH TARGET physfs_lib PROPERTY IMPORTED_LOCATION)
  797. install(FILES ${SQUIRREL_LIB_PATH} ${SQSTDLIB_LIB_PATH} ${PHYSFS_LIB_PATH} DESTINATION ${INSTALL_SUBDIR_BIN})
  798. endif()
  799. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/INSTALL.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt ${CMAKE_CURRENT_SOURCE_DIR}/NEWS.md DESTINATION ${INSTALL_SUBDIR_DOC})
  800. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/credits.stxt DESTINATION ${INSTALL_SUBDIR_SHARE})
  801. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.appdata.xml DESTINATION "share/metainfo" )
  802. install(DIRECTORY
  803. ${CMAKE_CURRENT_SOURCE_DIR}/data/images
  804. ${CMAKE_CURRENT_SOURCE_DIR}/data/fonts
  805. ${CMAKE_CURRENT_SOURCE_DIR}/data/music
  806. ${CMAKE_CURRENT_SOURCE_DIR}/data/scripts
  807. ${CMAKE_CURRENT_SOURCE_DIR}/data/shader
  808. ${CMAKE_CURRENT_SOURCE_DIR}/data/speech
  809. ${CMAKE_CURRENT_SOURCE_DIR}/data/sounds
  810. ${CMAKE_CURRENT_SOURCE_DIR}/data/locale
  811. DESTINATION ${INSTALL_SUBDIR_SHARE})
  812. if(CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo")
  813. install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/levels
  814. DESTINATION ${INSTALL_SUBDIR_SHARE}
  815. PATTERN "data/levels/test" EXCLUDE
  816. PATTERN "data/levels/test_old" EXCLUDE
  817. PATTERN "data/levels/incubator" EXCLUDE
  818. PATTERN "data/levels/misc/menu.stl.in" EXCLUDE)
  819. else()
  820. install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/levels
  821. DESTINATION ${INSTALL_SUBDIR_SHARE}
  822. PATTERN "data/levels/misc/menu.stl.in" EXCLUDE)
  823. endif()
  824. install(FILES "${CMAKE_BINARY_DIR}/data/levels/misc/menu.stl" DESTINATION "${INSTALL_SUBDIR_SHARE}/levels/misc")
  825. ## Create config.h now that INSTALL_SUBDIR_* have been set.
  826. configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
  827. ## Configure main menu logo
  828. if(("${SUPERTUX_VERSION_STRING}" MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+$") OR IS_SUPERTUX_RELEASE)
  829. set(LOGO_FILE "logo_final.sprite")
  830. else()
  831. set(LOGO_FILE "logo.sprite")
  832. endif()
  833. configure_file(data/levels/misc/menu.stl.in ${CMAKE_BINARY_DIR}/data/levels/misc/menu.stl )
  834. ## CPack/Installation-specific stuff
  835. include(InstallRequiredSystemLibraries)
  836. set(DIRS ${Boost_LIBRARY_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/external/squirrel ${CMAKE_CURRENT_BINARY_DIR}/external/tinygettext)
  837. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT DISABLE_CPACK_BUNDLING)
  838. set(INFOPLIST_CFBUNDLEEXECUTABLE "SuperTux")
  839. find_package(png)
  840. foreach (_file ${PNG_LIBRARIES})
  841. get_filename_component(_resolvedFile "${_file}" REALPATH)
  842. get_filename_component(_name "${_file}" NAME)
  843. install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name})
  844. endforeach()
  845. find_package(jpeg)
  846. foreach (_file ${JPEG_LIBRARIES})
  847. get_filename_component(_resolvedFile "${_file}" REALPATH)
  848. get_filename_component(_name "${_file}" NAME)
  849. install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name})
  850. endforeach()
  851. install(CODE "
  852. if(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\" MATCHES \".*\\\\.app.*\")
  853. include(BundleUtilities)
  854. fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")
  855. endif()
  856. ")
  857. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist.in" "${CMAKE_BINARY_DIR}/tools/darwin/info.plist")
  858. set(CPACK_BUNDLE_NAME "SuperTux")
  859. set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/tools/darwin/info.plist")
  860. set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.icns")
  861. set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/startup.sh")
  862. set(CPACK_DMG_VOLUME_NAME "SuperTux ${SUPERTUX_VERSION_STRING}")
  863. set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/dsstore_setup.scpt")
  864. set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/background.png")
  865. endif()
  866. set(CPACK_PACKAGE_NAME "SuperTux")
  867. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux")
  868. set(CPACK_PACKAGE_VENDOR "SuperTux Devel Team")
  869. set(CPACK_PACKAGE_CONTACT "SuperTux Devel Team <supertux-devel@lists.lethargik.org>")
  870. set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;${CMAKE_BINARY_DIR};/\\\\..*")
  871. set(CPACK_DEBIAN_PACKAGE_NAME "supertux2")
  872. set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.5), libgcc1 (>= 1:4.1), libgl1-mesa-glx | libgl1, libogg0 (>= 1.1.3), libopenal0a, libphysfs-1.0-0, libsdl-image1.2 (>= 1.2.5), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.2), libvorbis0a (>= 1.1.2), libvorbisfile3 (>= 1.1.2), libcurl3 (>= 7.16)")
  873. set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Classic 2D jump 'n run sidescroller with Tux\n SuperTux is a classic 2D jump 'n run sidescroller game in a similar\n style like the original SuperMario games. This release of SuperTux\n features 9 enemies, 26 playable levels, software and OpenGL rendering\n modes, configurable joystick and keyboard input, new music and\n completely redone graphics.\n .\n This is a development snapshot of SuperTux. It may suffer from\n critical bugs and has not been fully tested. \n .\n Homepage: http://supertux.lethargik.org/")
  874. set(CPACK_DEBIAN_PACKAGE_SECTION "games")
  875. set(CPACK_RPM_PACKAGE_NAME "supertux2")
  876. set(CPACK_RPM_PACKAGE_DESCRIPTION "Classic 2D jump 'n run sidescroller with Tux\n SuperTux is a classic 2D jump 'n run sidescroller game in a similar\n style like the original SuperMario games. This release of SuperTux\n features 9 enemies, 26 playable levels, software and OpenGL rendering\n modes, configurable joystick and keyboard input, new music and\n completely redone graphics.\n .\n This is a development snapshot of SuperTux. It may suffer from\n critical bugs and has not been fully tested. \n .\n Homepage: http://supertux.lethargik.org/")
  877. set(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)")
  878. set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade")
  879. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
  880. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
  881. set(CPACK_PACKAGE_VERSION_MAJOR ${SUPERTUX_VERSION_MAJOR})
  882. set(CPACK_PACKAGE_VERSION_MINOR ${SUPERTUX_VERSION_MINOR})
  883. if(SUPERTUX_VERSION_TWEAK)
  884. set(CPACK_PACKAGE_VERSION_PATCH "${SUPERTUX_VERSION_PATCH}.${SUPERTUX_VERSION_TWEAK}")
  885. else()
  886. set(CPACK_PACKAGE_VERSION_PATCH ${SUPERTUX_VERSION_PATCH})
  887. endif(SUPERTUX_VERSION_TWEAK)
  888. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-${SUPERTUX_SYSTEM_NAME}")
  889. set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-Source")
  890. set(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux")
  891. set(CPACK_PACKAGE_EXECUTABLES "supertux2" "SuperTux")
  892. if(WIN32 AND NOT UNIX)
  893. set(CPACK_NSIS_INSTALLED_ICON_NAME "supertux2")
  894. set(CPACK_NSIS_DISPLAY_NAME "SuperTux")
  895. set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
  896. set(CPACK_WIX_PROGRAM_MENU_FOLDER "")
  897. set(CPACK_WIX_UPGRADE_GUID "93E16F4E-0A68-422A-8ADC-47BE5B9433B2")
  898. set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico")
  899. set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/banner.png")
  900. set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/dialog.png")
  901. set(CPACK_GENERATOR WIX)
  902. else(WIN32 AND NOT UNIX)
  903. endif(WIN32 AND NOT UNIX)
  904. include(CPack)
  905. # move some config clutter to the advanced section
  906. mark_as_advanced(
  907. INSTALL_SUBDIR_BIN
  908. INSTALL_SUBDIR_SHARE
  909. INSTALL_SUBDIR_DOC
  910. )
  911. mark_as_advanced(
  912. CMAKE_BACKWARDS_COMPATIBILITY
  913. CMAKE_BUILD_TYPE
  914. CMAKE_INSTALL_PREFIX
  915. EXECUTABLE_OUTPUT_PATH
  916. LIBRARY_OUTPUT_PATH
  917. CMAKE_OSX_ARCHITECTURES
  918. CMAKE_OSX_SYSROOT
  919. )
  920. mark_as_advanced(
  921. APPDATADIR
  922. )
  923. mark_as_advanced(
  924. Boost_INCLUDE_DIR
  925. Boost_LIBRARIES
  926. )
  927. mark_as_advanced(
  928. GLEW_INCLUDE_DIR
  929. GLEW_LIBRARY
  930. )
  931. mark_as_advanced(
  932. SDL2_INCLUDE_DIRS
  933. SDL2_LIBRARIES
  934. )
  935. mark_as_advanced(
  936. SDL2IMAGE_INCLUDE_DIRS
  937. SDL2IMAGE_LIBRARIES
  938. )
  939. mark_as_advanced(
  940. OPENAL_INCLUDE_DIR
  941. OPENAL_LIBRARY
  942. )
  943. mark_as_advanced(
  944. SDL2TTF_INCLUDE_DIRS
  945. SDL2TTF_LIBRARIES
  946. )
  947. mark_as_advanced(
  948. OGG_LIBRARY
  949. VORBISENC_LIBRARY
  950. VORBISFILE_LIBRARY
  951. VORBIS_INCLUDE_DIR
  952. VORBIS_LIBRARY
  953. )
  954. mark_as_advanced(
  955. PHYSFS_INCLUDE_DIR
  956. PHYSFS_LIBRARY
  957. )