CMakeLists.txt 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  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. check_symbol_exists("PHYSFS_getPrefDir" "${PHYSFS_INCLUDE_DIR}/physfs.h" HAVE_PHYSFS_GETPREFDIR)
  193. if(HAVE_PHYSFS_GETPREFDIR)
  194. set(USE_SYSTEM_PHYSFS ON CACHE BOOL "Use preinstalled physfs (must support getPrefDir)")
  195. else(HAVE_PHYSFS_GETPREFDIR)
  196. set(USE_SYSTEM_PHYSFS OFF CACHE BOOL "Use preinstalled physfs (must support getPrefDir)")
  197. endif(HAVE_PHYSFS_GETPREFDIR)
  198. if(NOT USE_SYSTEM_PHYSFS)
  199. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt)
  200. message(FATAL_ERROR "physfs submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/physfs/CMakeLists.txt is missing")
  201. endif()
  202. if(WIN32)
  203. set(PHYSFS_BUILD_SHARED TRUE)
  204. set(PHYSFS_BUILD_STATIC FALSE)
  205. else(WIN32)
  206. set(PHYSFS_BUILD_SHARED FALSE)
  207. set(PHYSFS_BUILD_STATIC TRUE)
  208. endif()
  209. set(PHYSFS_PREFIX ${CMAKE_BINARY_DIR}/physfs/)
  210. ExternalProject_Add(physfs
  211. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/physfs/"
  212. CMAKE_ARGS
  213. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  214. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  215. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  216. -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  217. -DCMAKE_INSTALL_PREFIX=${PHYSFS_PREFIX}
  218. -DLIB_SUFFIX=${LIB_SUFFIX}
  219. -DPHYSFS_BUILD_SHARED=${PHYSFS_BUILD_SHARED}
  220. -DPHYSFS_BUILD_STATIC=${PHYSFS_BUILD_STATIC}
  221. -DPHYSFS_BUILD_TEST=FALSE)
  222. if(WIN32)
  223. add_library(physfs_lib SHARED IMPORTED)
  224. set_target_properties(physfs_lib PROPERTIES IMPORTED_LOCATION "${PHYSFS_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}physfs${CMAKE_SHARED_LIBRARY_SUFFIX}")
  225. set_target_properties(physfs_lib PROPERTIES IMPORTED_IMPLIB "${PHYSFS_PREFIX}/lib${LIB_SUFFIX}/physfs${CMAKE_LINK_LIBRARY_SUFFIX}")
  226. else()
  227. add_library(physfs_lib STATIC IMPORTED)
  228. set_target_properties(physfs_lib PROPERTIES IMPORTED_LOCATION "${PHYSFS_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}physfs${CMAKE_STATIC_LIBRARY_SUFFIX}")
  229. endif()
  230. set(PHYSFS_INCLUDE_DIR "${PHYSFS_PREFIX}/include/")
  231. endif()
  232. include_directories(BEFORE SYSTEM ${PHYSFS_INCLUDE_DIR})
  233. ## The curl headers are in the standard include path in dependencies
  234. ## so it's not required to add them here
  235. find_package(CURL REQUIRED)
  236. if(WIN32 AND VCPKG_BUILD)
  237. list(LENGTH CURL_LIBRARY CURL_LIBRARY_LENGTH)
  238. if (CURL_LIBRARY_LENGTH EQUAL 1)
  239. set(CURL_LIBRARY_DEBUG_LIB ${CURL_LIBRARY})
  240. set(CURL_LIBRARY_RELEASE_LIB ${CURL_LIBRARY_DEBUG_LIB}/../../../lib/libcurl.lib)
  241. get_filename_component(CURL_LIBRARY_RELEASE_LIB ${CURL_LIBRARY_RELEASE_LIB} REALPATH)
  242. unset(CURL_LIBRARY CACHE)
  243. unset(CURL_LIBRARY)
  244. unset(CURL_LIBRARIES CACHE)
  245. unset(CURL_LIBRARIES)
  246. set(CURL_LIBRARY "debug;${CURL_LIBRARY_DEBUG_LIB};optimized;${CURL_LIBRARY_RELEASE_LIB}")
  247. set(CURL_LIBRARIES ${CURL_LIBRARY})
  248. endif()
  249. endif()
  250. if(CURL_FOUND)
  251. include_directories(SYSTEM ${CURL_INCLUDE_DIR})
  252. set(HAVE_LIBCURL TRUE)
  253. endif(CURL_FOUND)
  254. #find_package(ICONV REQUIRED)
  255. #include_directories(SYSTEM ${ICONV_INCLUDE_DIR})
  256. #link_libraries(${ICONV_LIBRARY})
  257. if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  258. ## Find revision of WC
  259. mark_as_advanced(GIT_EXECUTABLE)
  260. find_program(GIT_EXECUTABLE git)
  261. if(NOT GIT_EXECUTABLE EQUAL "GIT_EXECUTABLE-NOTFOUND")
  262. include(GetGitRevisionDescription)
  263. git_describe(VERSION_STRING_GIT "--tags" "--match" "?[0-9]*.[0-9]*.[0-9]*")
  264. string(REPLACE "v" "" VERSION_LIST ${VERSION_STRING_GIT})
  265. string(REGEX REPLACE "(-|_|\\.)" ";" VERSION_LIST ";${VERSION_LIST}")
  266. endif()
  267. endif(EXISTS "${CMAKE_SOURCE_DIR}/.git")
  268. get_filename_component(BASEDIR ${CMAKE_SOURCE_DIR} NAME)
  269. if("${VERSION_LIST}" STREQUAL "")
  270. if(${BASEDIR} MATCHES "supertux2-[0-9\\.]*")
  271. string(REGEX REPLACE "(\\.|_|-)" ";" VERSION_LIST ${BASEDIR})
  272. endif()
  273. endif()
  274. file(GLOB ORIG_TGZ ../*.orig.tar.gz)
  275. if("${VERSION_LIST}" STREQUAL "" AND (NOT "${ORIG_TGZ}" STREQUAL ""))
  276. get_filename_component(BASEDIR ${ORIG_TGZ} NAME)
  277. string(REGEX REPLACE "(\\.|_|-)" ";" VERSION_LIST ${BASEDIR})
  278. endif()
  279. list(LENGTH VERSION_LIST VERSION_LIST_SIZE)
  280. if(${VERSION_LIST_SIZE} GREATER 0)
  281. list(GET VERSION_LIST 1 MAJOR_VERSION_GIT)
  282. list(GET VERSION_LIST 2 MINOR_VERSION_GIT)
  283. list(GET VERSION_LIST 3 PATCH_VERSION_GIT)
  284. if("${VERSION_STRING_GIT}" STREQUAL "")
  285. set(VERSION_STRING_GIT "${MAJOR_VERSION_GIT}.${MINOR_VERSION_GIT}.${PATCH_VERSION_GIT}")
  286. endif()
  287. configure_file("${CMAKE_SOURCE_DIR}/version.cmake.in" "${CMAKE_SOURCE_DIR}/version.cmake")
  288. endif()
  289. if(NOT EXISTS "${CMAKE_SOURCE_DIR}/version.cmake")
  290. message( SEND_ERROR "Cound not find GIT or valid version.cmake. Version information will be invalid." )
  291. endif(NOT EXISTS "${CMAKE_SOURCE_DIR}/version.cmake")
  292. include("${CMAKE_SOURCE_DIR}/version.cmake")
  293. set(SUPERTUX_VERSION ${SUPERTUX_VERSION_STRING})
  294. configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h )
  295. set_source_files_properties(${CMAKE_BINARY_DIR}/version.h
  296. PROPERTIES GENERATED true)
  297. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/main.cpp
  298. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  299. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/title_screen.cpp
  300. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  301. set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/addon/addon_manager.cpp
  302. PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
  303. ## Configure doxygen
  304. # Adapted from https://tty1.net/blog/2014/cmake-doxygen_en.html
  305. # add a target to generate API documentation with Doxygen
  306. find_package(Doxygen)
  307. option(BUILD_DOCUMENTATION "Build API documentation using Doxygen" ${DOXYGEN_FOUND})
  308. if(BUILD_DOCUMENTATION)
  309. if(NOT DOXYGEN_FOUND)
  310. message(FATAL_ERROR "Doxygen is needed to build the documentation.")
  311. endif()
  312. set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
  313. set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile)
  314. configure_file(${doxyfile_in} ${doxyfile} @ONLY)
  315. add_custom_target(doc
  316. COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
  317. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  318. COMMENT "Generating API documentation with Doxygen"
  319. VERBATIM)
  320. endif()
  321. ## Check platform-dependent build options
  322. include(ConfigureChecks)
  323. # Include altivec wrapper on ppc
  324. if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
  325. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
  326. endif()
  327. ## Also build external/squirrel
  328. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt)
  329. message(FATAL_ERROR "squirrel submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/CMakeLists.txt is missing")
  330. endif()
  331. set(SQUIRREL_PREFIX ${CMAKE_BINARY_DIR}/squirrel/ex)
  332. ExternalProject_Add(squirrel
  333. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/squirrel/"
  334. CMAKE_ARGS
  335. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  336. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  337. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  338. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  339. -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  340. -DCMAKE_INSTALL_PREFIX=${SQUIRREL_PREFIX}
  341. -DINSTALL_INC_DIR=include)
  342. if(WIN32)
  343. add_library(squirrel_lib SHARED IMPORTED)
  344. set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}squirrel${CMAKE_SHARED_LIBRARY_SUFFIX}")
  345. set_target_properties(squirrel_lib PROPERTIES IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/squirrel${CMAKE_LINK_LIBRARY_SUFFIX}")
  346. add_library(sqstdlib_lib SHARED IMPORTED)
  347. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}sqstdlib${CMAKE_SHARED_LIBRARY_SUFFIX}")
  348. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_IMPLIB "${SQUIRREL_PREFIX}/lib/sqstdlib${CMAKE_LINK_LIBRARY_SUFFIX}")
  349. #For debug run purposes
  350. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mk/msvc/run_supertux.bat.in" "${PROJECT_BINARY_DIR}/run_supertux.bat")
  351. else()
  352. add_library(squirrel_lib STATIC IMPORTED)
  353. set_target_properties(squirrel_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}squirrel_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
  354. add_library(sqstdlib_lib STATIC IMPORTED)
  355. set_target_properties(sqstdlib_lib PROPERTIES IMPORTED_LOCATION "${SQUIRREL_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}sqstdlib_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
  356. endif()
  357. include_directories(SYSTEM ${SQUIRREL_PREFIX}/include)
  358. ## Also build external/tinygettext
  359. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt)
  360. message(FATAL_ERROR "tinygettext submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/CMakeLists.txt is missing")
  361. endif()
  362. # Include altivec wrapper on ppc
  363. if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
  364. set(TINYGETTEXT_CXX_FLAGS "-isystem ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc ${CMAKE_CXX_FLAGS}")
  365. else()
  366. set(TINYGETTEXT_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  367. endif()
  368. set(TINYGETTEXT_PREFIX ${CMAKE_BINARY_DIR}/tinygettext/)
  369. ExternalProject_Add(tinygettext
  370. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/tinygettext/"
  371. CMAKE_ARGS
  372. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  373. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  374. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  375. -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
  376. -DCMAKE_CXX_FLAGS=${TINYGETTEXT_CXX_FLAGS}
  377. -DBUILD_SHARED_LIBS=OFF
  378. -DHAVE_SDL=ON
  379. -DVCPKG_BUILD=${VCPKG_BUILD}
  380. -DCMAKE_INSTALL_PREFIX=${TINYGETTEXT_PREFIX}
  381. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  382. -DSDL2_LIBRARIES=${SDL2_LIBRARIES}
  383. -DSDL2_INCLUDE_DIRS=${SDL2_INCLUDE_DIRS}
  384. -DLIB_SUFFIX=${LIB_SUFFIX})
  385. add_library(tinygettext_lib STATIC IMPORTED)
  386. set_target_properties(tinygettext_lib PROPERTIES IMPORTED_LOCATION "${TINYGETTEXT_PREFIX}/lib${LIB_SUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}tinygettext${CMAKE_STATIC_LIBRARY_SUFFIX}")
  387. include_directories(SYSTEM ${TINYGETTEXT_PREFIX}/include)
  388. ## external/SDL_ttf with patches
  389. find_package(Freetype REQUIRED)
  390. find_package(RAQM)
  391. set(SDL_TTF_PREFIX ${CMAKE_BINARY_DIR}/SDL_ttf/)
  392. ExternalProject_Add(SDL_ttf
  393. SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/SDL_ttf/"
  394. CMAKE_ARGS
  395. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  396. -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
  397. -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
  398. -DCMAKE_INSTALL_PREFIX=${SDL_TTF_PREFIX}
  399. -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
  400. -DWITH_RAQM=${RAQM_FOUND}
  401. -DRAQM_LIBRARIES=${RAQM_LIBRARY}
  402. -DRAQM_INCLUDE_DIR=${RAQM_INCLUDE_DIR}
  403. -DBUILD_SHARED_LIBS=OFF)
  404. add_library(SDL_ttf_lib STATIC IMPORTED)
  405. set_target_properties(SDL_ttf_lib PROPERTIES IMPORTED_LOCATION "${SDL_TTF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_ttf${CMAKE_STATIC_LIBRARY_SUFFIX}")
  406. link_directories(${SDL_TTF_PREFIX}/lib)
  407. include_directories(SYSTEM ${SDL_TTF_PREFIX}/include/SDL2)
  408. if(RAQM_FOUND)
  409. find_package(Fribidi REQUIRED)
  410. find_package(Harfbuzz REQUIRED)
  411. set_target_properties(SDL_ttf_lib PROPERTIES INTERFACE_LINK_LIBRARIES "${RAQM_LIBRARIES}")
  412. endif()
  413. ## Some additional include paths
  414. include_directories(${CMAKE_BINARY_DIR}/)
  415. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
  416. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/findlocale/)
  417. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/obstack/)
  418. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/include/)
  419. include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/external/SDL_SavePNG/)
  420. if(WIN32)
  421. add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX)
  422. add_definitions(-DWIN32)
  423. endif(WIN32)
  424. ## Lint
  425. if(CMAKE_VERSION VERSION_GREATER 3.6)
  426. if (USE_CLANG_TIDY)
  427. find_program(
  428. CLANG_TIDY_EXE
  429. NAMES "clang-tidy"
  430. DOC "Path to clang-tidy executable"
  431. )
  432. if(NOT CLANG_TIDY_EXE)
  433. message(FATAL_ERROR "clang-tidy not found.")
  434. else()
  435. message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
  436. set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
  437. endif()
  438. endif()
  439. endif()
  440. ## Build list of sources for supertux binary
  441. file(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
  442. file(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp src/video/null/*.cpp)
  443. file(GLOB SUPERTUX_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_BINARY_DIR}/tmp/*.rc")
  444. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt)
  445. message(FATAL_ERROR "sexp-cpp submodule is not checked out or ${CMAKE_CURRENT_SOURCE_DIR}/external/sexp-cpp/CMakeLists.txt is missing")
  446. endif()
  447. file(GLOB SEXP_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/sexp-cpp/src/*.cpp)
  448. add_library(sexp STATIC ${SEXP_SOURCES_CXX})
  449. target_compile_definitions(sexp PRIVATE -DSEXP_USE_LOCALE)
  450. file(GLOB SAVEPNG_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/SDL_SavePNG/savepng.c)
  451. add_library(savepng STATIC ${SAVEPNG_SOURCES_CXX})
  452. target_include_directories(savepng SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS})
  453. target_link_libraries(savepng PUBLIC ${PNG_LIBRARIES})
  454. if(HAVE_OPENGL)
  455. file(GLOB SUPERTUX_OPENGL_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/video/gl/*.cpp)
  456. set(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_OPENGL_SOURCES})
  457. endif(HAVE_OPENGL)
  458. ## Sort source lists to have deterministic linking order
  459. list(SORT SUPERTUX_SOURCES_C)
  460. list(SORT SUPERTUX_SOURCES_CXX)
  461. list(SORT SUPERTUX_RESOURCES)
  462. if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  463. set(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  464. endif(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
  465. ## Compile everything at once (roughly equivalent to cat *.cpp | gcc)
  466. option(COMPILE_AMALGATION "Compile all the files together at once (experimental)" OFF)
  467. if(COMPILE_AMALGATION)
  468. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "// Includes all source files of the project\n")
  469. foreach(ST_FILE ${SUPERTUX_SOURCES_CXX})
  470. file(RELATIVE_PATH CXX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src "${CMAKE_CURRENT_SOURCE_DIR}/${ST_FILE}")
  471. file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "#include \"${CXX_FILE}\"\n")
  472. endforeach(ST_FILE)
  473. ## Build instead of CXX sources
  474. set(SUPERTUX_SOURCES_CXX ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  475. else(COMPILE_AMALGATION)
  476. if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  477. file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  478. endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
  479. endif(COMPILE_AMALGATION)
  480. ## Debug options
  481. option(WERROR "Stop on first compiler warning" OFF)
  482. option(WARNINGS "Enable long list of warnings for compiler to check" OFF)
  483. option(USE_CLANG_TIDY "Run clang-tidy" OFF)
  484. if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  485. set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
  486. set(CMAKE_C_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
  487. set(CMAKE_CXX_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
  488. set(CMAKE_C_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
  489. set(CMAKE_LD_FLAGS_PROFILE "-lgmon" CACHE STRING "Profile flags")
  490. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -funit-at-a-time")
  491. if(WERROR)
  492. add_definitions(-Werror)
  493. else(WERROR)
  494. remove_definitions(-Werror)
  495. endif(WERROR)
  496. if(WARNINGS)
  497. # temporarily disabled:
  498. # -Wsign-conversion -Wfloat-equal -Wundef -Wswitch-default
  499. # -Wswitch-enum -Wsign-promo -Wcast-qual -Woverloaded-virtual -Wmissing-format-attribute
  500. # -Wpadded -Wabi -Winline -Wunsafe-loop-optimizations -Wstrict-overflow=5
  501. # fails on MinGW:
  502. # -ansi
  503. if(CMAKE_COMPILER_IS_GNUCXX)
  504. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  505. "-fdiagnostics-show-option "
  506. "-pedantic "
  507. "-Wno-long-long "
  508. "-Wcast-align "
  509. "-Wdisabled-optimization "
  510. "-Winit-self -Winvalid-pch "
  511. "-Wmissing-include-dirs "
  512. "-Wmissing-noreturn "
  513. "-Wpacked -Wredundant-decls "
  514. "-Wformat=2 "
  515. "-Weffc++ "
  516. "-Wctor-dtor-privacy "
  517. "-Wno-unused-parameter "
  518. "-Wshadow "
  519. "-Wnon-virtual-dtor "
  520. "-Wcast-qual "
  521. "-Wold-style-cast "
  522. "-Wzero-as-null-pointer-constant "
  523. "-Wconversion "
  524. "-Wlogical-op "
  525. "-Wstrict-null-sentinel "
  526. "-Wsuggest-override "
  527. )
  528. if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8)
  529. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  530. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  531. "-Wint-in-bool-context "
  532. )
  533. endif()
  534. if(Boost_VERSION LESS 106500)
  535. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  536. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  537. "-Wno-implicit-fallthrough ")
  538. endif()
  539. elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  540. string(CONCAT SUPERTUX2_EXTRA_WARNING_FLAGS
  541. "${SUPERTUX2_EXTRA_WARNING_FLAGS} "
  542. "-Weverything "
  543. # flags that we deliberately ignore
  544. "-Wno-c++98-compat "
  545. "-Wno-c++98-compat-pedantic "
  546. "-Wno-float-equal "
  547. "-Wno-padded "
  548. "-Wno-weak-vtables "
  549. "-Wno-disabled-macro-expansion "
  550. "-Wno-documentation "
  551. "-Wno-reserved-id-macro "
  552. "-Wno-sign-conversion "
  553. # warnings that should probably be fixed in code
  554. "-Wno-documentation-unknown-command "
  555. "-Wno-inconsistent-missing-destructor-override "
  556. "-Wno-deprecated-dynamic-exception-spec "
  557. "-Wno-deprecated "
  558. "-Wno-switch-enum "
  559. "-Wno-covered-switch-default "
  560. "-Wno-exit-time-destructors "
  561. "-Wno-global-constructors "
  562. "-Wno-duplicate-enum "
  563. )
  564. endif()
  565. endif(WARNINGS)
  566. endif()
  567. ## If xgettext is available, generate messages.pot for sources
  568. option(GENERATE_MESSAGESPOT "Generate messages.pot files" OFF)
  569. if(GENERATE_MESSAGESPOT)
  570. mark_as_advanced(
  571. XGETTEXT_EXECUTABLE
  572. )
  573. find_program(XGETTEXT_EXECUTABLE xgettext)
  574. if(NOT XGETTEXT_EXECUTABLE)
  575. message(STATUS "Warning: xgettext not found - will not update messages.pot")
  576. else(NOT XGETTEXT_EXECUTABLE)
  577. message(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
  578. set(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/data/locale/messages.pot)
  579. add_custom_command(
  580. OUTPUT ${MESSAGES_POT_FILE}
  581. COMMAND ${XGETTEXT_EXECUTABLE}
  582. ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES_CXX}
  583. DEPENDS ${SUPERTUX_SOURCES_CXX}
  584. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  585. COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
  586. )
  587. list(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
  588. file(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} data/levels/*)
  589. foreach(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS})
  590. file(GLOB SUPERTUX_LEVELS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt)
  591. ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4
  592. if(SUPERTUX_LEVELS)
  593. set(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot)
  594. add_custom_command(
  595. OUTPUT ${MESSAGES_POT_FILE}
  596. COMMAND ${XGETTEXT_EXECUTABLE}
  597. ARGS --keyword="_:1" --language=Lisp --force-po --sort-by-file "--output=${MESSAGES_POT_FILE}" ${SUPERTUX_LEVELS}
  598. DEPENDS ${SUPERTUX_LEVELS}
  599. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  600. COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
  601. )
  602. list(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
  603. endif(SUPERTUX_LEVELS)
  604. endforeach(SUPERTUX_LEVEL_DIR)
  605. add_custom_target(
  606. supertux2-messages ALL
  607. DEPENDS ${MESSAGES_POT_FILES}
  608. )
  609. endif(NOT XGETTEXT_EXECUTABLE)
  610. endif(GENERATE_MESSAGESPOT)
  611. ## Some additional compiler switches
  612. if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  613. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
  614. endif()
  615. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  616. add_definitions(-DMACOSX)
  617. endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  618. ## On Windows, add an icon
  619. if(WIN32)
  620. # set(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
  621. if(MINGW)
  622. add_custom_command(
  623. OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o
  624. 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)
  625. set(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
  626. endif(MINGW)
  627. endif(WIN32)
  628. ## Build miniswig and generate miniswig wrapper
  629. option(GENERATE_WRAPPER "Build miniswig and generate the wrapper" OFF)
  630. if(GENERATE_WRAPPER)
  631. add_subdirectory(tools/miniswig)
  632. add_custom_command(
  633. OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp
  634. COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_CXX_COMPILER}
  635. 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
  636. COMMAND tools/miniswig/miniswig
  637. 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
  638. DEPENDS tools/miniswig/miniswig
  639. IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.interface.hpp
  640. )
  641. if(USE_CLANG_TIDY)
  642. set_target_properties(miniswig PROPERTIES CXX_CLANG_TIDY "")
  643. endif()
  644. endif(GENERATE_WRAPPER)
  645. ## Generate supertux executable in the right place
  646. #set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
  647. set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
  648. ## Add target for supertux binary
  649. add_library(supertux2_c OBJECT ${SUPERTUX_SOURCES_C})
  650. add_library(supertux2_lib STATIC ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
  651. if(WIN32)
  652. add_executable(supertux2 WIN32 src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
  653. target_link_libraries(supertux2 ${SDL2MAIN_LIBRARIES})
  654. else()
  655. add_executable(supertux2 src/main.cpp)
  656. endif(WIN32)
  657. target_link_libraries(supertux2 supertux2_lib Boost::filesystem Boost::locale)
  658. set_target_properties(supertux2_lib PROPERTIES OUTPUT_NAME supertux2_lib)
  659. set_target_properties(supertux2_lib PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS}")
  660. if(WIN32 AND NOT VCPKG_BUILD)
  661. ## Copy dlls on windows
  662. add_custom_command(TARGET supertux2_lib POST_BUILD
  663. COMMAND ${CMAKE_COMMAND} -E copy_directory
  664. "${DEPENDENCY_FOLDER}/dll"
  665. $<TARGET_FILE_DIR:supertux2_lib>)
  666. endif(WIN32 AND NOT VCPKG_BUILD)
  667. ## Link supertux binary with squirrel and other libraries
  668. add_dependencies(supertux2_lib tinygettext)
  669. add_dependencies(supertux2_lib squirrel)
  670. add_dependencies(supertux2_lib SDL_ttf)
  671. if(VCPKG_BUILD)
  672. target_include_directories(supertux2_lib PUBLIC ${CURL_INCLUDE_DIRS})
  673. endif()
  674. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL2_INCLUDE_DIRS})
  675. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL2IMAGE_INCLUDE_DIRS})
  676. target_include_directories(supertux2_lib SYSTEM PUBLIC ${SDL_TTF_PREFIX}/include/SDL2)
  677. if(VCPKG_BUILD)
  678. target_link_libraries(supertux2_lib PRIVATE SDL2::SDL2main SDL2::SDL2 SDL2_image)
  679. else()
  680. target_link_libraries(supertux2_lib PUBLIC ${SDL2_LIBRARIES})
  681. target_link_libraries(supertux2_lib PUBLIC ${SDL2IMAGE_LIBRARIES})
  682. endif()
  683. target_link_libraries(supertux2_lib PUBLIC SDL_ttf_lib)
  684. target_link_libraries(supertux2_lib PUBLIC ${FREETYPE_LIBRARIES})
  685. if(RAQM_FOUND)
  686. target_link_libraries(supertux2_lib PUBLIC ${HARFBUZZ_LIBRARY} ${FRIBIDI_LIBRARY} ${RAQM_LIBRARY})
  687. endif()
  688. target_link_libraries(supertux2_lib PUBLIC squirrel_lib)
  689. target_link_libraries(supertux2_lib PUBLIC sqstdlib_lib)
  690. target_link_libraries(supertux2_lib PUBLIC tinygettext_lib)
  691. target_link_libraries(supertux2_lib PUBLIC sexp)
  692. target_link_libraries(supertux2_lib PUBLIC savepng)
  693. if(VCPKG_BUILD)
  694. target_link_libraries(supertux2_lib PUBLIC OpenAL::OpenAL)
  695. else()
  696. target_link_libraries(supertux2_lib PUBLIC ${OPENAL_LIBRARY})
  697. endif()
  698. target_link_libraries(supertux2_lib PUBLIC ${OGGVORBIS_LIBRARIES})
  699. target_link_libraries(supertux2_lib PUBLIC ${Boost_LIBRARIES})
  700. if(USE_SYSTEM_PHYSFS)
  701. target_link_libraries(supertux2_lib PUBLIC ${PHYSFS_LIBRARY})
  702. else()
  703. add_dependencies(supertux2_lib physfs)
  704. target_link_libraries(supertux2_lib PUBLIC physfs_lib)
  705. if(APPLE)
  706. target_link_libraries(supertux2_lib PUBLIC "-framework CoreFoundation")
  707. target_link_libraries(supertux2_lib PUBLIC "-framework Foundation")
  708. target_link_libraries(supertux2_lib PUBLIC "-framework IOKit")
  709. endif()
  710. endif()
  711. if(HAVE_OPENGL)
  712. target_link_libraries(supertux2_lib PUBLIC ${OPENGL_LIBRARY})
  713. if(NOT ENABLE_OPENGLES2)
  714. if(GLBINDING_FOUND)
  715. target_link_libraries(supertux2_lib PUBLIC ${GLBINDING_LIBRARIES})
  716. else()
  717. target_link_libraries(supertux2_lib PUBLIC GLEW::GLEW)
  718. endif()
  719. endif()
  720. endif(HAVE_OPENGL)
  721. if(HAVE_LIBCURL)
  722. if(VCPKG_BUILD)
  723. target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARIES})
  724. else()
  725. target_link_libraries(supertux2_lib PUBLIC ${CURL_LIBRARY})
  726. endif()
  727. endif(HAVE_LIBCURL)
  728. if(BUILD_TESTS)
  729. find_package(Threads REQUIRED)
  730. # build gtest
  731. # ${CMAKE_CURRENT_SOURCE_DIR} in include_directories is needed to generate -isystem instead of -I flags
  732. add_library(gtest_main STATIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/src/gtest_main.cc)
  733. target_include_directories(gtest_main SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/include/)
  734. add_library(gtest STATIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/src/gtest-all.cc)
  735. target_include_directories(gtest SYSTEM PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/)
  736. target_include_directories(gtest SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/googletest/googletest/include/)
  737. # build SuperTux tests
  738. file(GLOB TEST_SUPERTUX_SOURCES tests/*.cpp)
  739. add_executable(test_supertux2 ${TEST_SUPERTUX_SOURCES})
  740. target_compile_options(test_supertux2 PRIVATE ${WARNINGS_CXX_FLAGS})
  741. target_link_libraries(test_supertux2
  742. gtest gtest_main
  743. supertux2_lib
  744. ${CMAKE_THREAD_LIBS_INIT})
  745. # add 'make test' target, use 'make test ARGS="-V"' or 'ctest -V' for verbose
  746. enable_testing()
  747. add_test(NAME test_supertux2
  748. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  749. COMMAND test_supertux2)
  750. endif()
  751. ## Install stuff
  752. option(DISABLE_CPACK_BUNDLING "Build an .app bundle without CPack" OFF)
  753. if(WIN32 AND NOT UNIX)
  754. set(INSTALL_SUBDIR_BIN "bin" CACHE STRING "Installation subdir for binaries")
  755. set(INSTALL_SUBDIR_SHARE "data" CACHE STRING "Installation subdir for data")
  756. set(INSTALL_SUBDIR_DOC "doc" CACHE STRING "Installation subdir for docs")
  757. if(VCPKG_BUILD)
  758. install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/" DESTINATION ${INSTALL_SUBDIR_BIN} FILES_MATCHING PATTERN "*.dll")
  759. else()
  760. install(FILES ${DLLS} DESTINATION ${INSTALL_SUBDIR_BIN})
  761. endif()
  762. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".")
  763. option(PACKAGE_VCREDIST "Package the VCREDIST libraries with the program" OFF)
  764. if(PACKAGE_VCREDIST)
  765. set(CMAKE_INSTALL_UCRT_LIBRARIES true)
  766. include(InstallRequiredSystemLibraries)
  767. endif()
  768. else(WIN32 AND NOT UNIX)
  769. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  770. set(INFOPLIST_CFBUNDLEEXECUTABLE "supertux2")
  771. set(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS" CACHE STRING "Installation subdir for binaries")
  772. set(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data" CACHE STRING "Installation subdir for data")
  773. set(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources" CACHE STRING "Installation subdir for docs")
  774. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist.in ${CMAKE_BINARY_DIR}/tools/darwin/info.plist)
  775. install(FILES ${CMAKE_BINARY_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
  776. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/receipt DESTINATION "SuperTux.app/Contents/_MASReceipt/")
  777. 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/")
  778. else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  779. set(INSTALL_SUBDIR_BIN "games" CACHE STRING "Installation subdir for binaries")
  780. set(INSTALL_SUBDIR_SHARE "share/games/supertux2" CACHE STRING "Installation subdir for data")
  781. set(INSTALL_SUBDIR_DOC "share/doc/supertux2" CACHE STRING "Installation subdir for docs")
  782. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
  783. set(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR_BIN}/supertux2")
  784. 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/")
  785. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.svg DESTINATION "share/icons/hicolor/scalable/apps")
  786. endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND DISABLE_CPACK_BUNDLING)
  787. endif(WIN32 AND NOT UNIX)
  788. install(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN})
  789. if(WIN32)
  790. get_property(SQUIRREL_LIB_PATH TARGET squirrel_lib PROPERTY IMPORTED_LOCATION)
  791. get_property(SQSTDLIB_LIB_PATH TARGET sqstdlib_lib PROPERTY IMPORTED_LOCATION)
  792. get_property(PHYSFS_LIB_PATH TARGET physfs_lib PROPERTY IMPORTED_LOCATION)
  793. install(FILES ${SQUIRREL_LIB_PATH} ${SQSTDLIB_LIB_PATH} ${PHYSFS_LIB_PATH} DESTINATION ${INSTALL_SUBDIR_BIN})
  794. endif()
  795. 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})
  796. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/credits.stxt DESTINATION ${INSTALL_SUBDIR_SHARE})
  797. install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.appdata.xml DESTINATION "share/metainfo" )
  798. install(DIRECTORY
  799. ${CMAKE_CURRENT_SOURCE_DIR}/data/images
  800. ${CMAKE_CURRENT_SOURCE_DIR}/data/fonts
  801. ${CMAKE_CURRENT_SOURCE_DIR}/data/music
  802. ${CMAKE_CURRENT_SOURCE_DIR}/data/scripts
  803. ${CMAKE_CURRENT_SOURCE_DIR}/data/shader
  804. ${CMAKE_CURRENT_SOURCE_DIR}/data/speech
  805. ${CMAKE_CURRENT_SOURCE_DIR}/data/sounds
  806. ${CMAKE_CURRENT_SOURCE_DIR}/data/locale
  807. DESTINATION ${INSTALL_SUBDIR_SHARE})
  808. if(CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo")
  809. install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/levels
  810. DESTINATION ${INSTALL_SUBDIR_SHARE}
  811. PATTERN "data/levels/test" EXCLUDE
  812. PATTERN "data/levels/test_old" EXCLUDE
  813. PATTERN "data/levels/incubator" EXCLUDE
  814. PATTERN "data/levels/misc/menu.stl.in" EXCLUDE)
  815. else()
  816. install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/levels
  817. DESTINATION ${INSTALL_SUBDIR_SHARE}
  818. PATTERN "data/levels/misc/menu.stl.in" EXCLUDE)
  819. endif()
  820. install(FILES "${CMAKE_BINARY_DIR}/data/levels/misc/menu.stl" DESTINATION "${INSTALL_SUBDIR_SHARE}/levels/misc")
  821. ## Create config.h now that INSTALL_SUBDIR_* have been set.
  822. configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
  823. ## Configure main menu logo
  824. if(("${SUPERTUX_VERSION_STRING}" MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+$") OR IS_SUPERTUX_RELEASE)
  825. set(LOGO_FILE "logo_final.sprite")
  826. else()
  827. set(LOGO_FILE "logo.sprite")
  828. endif()
  829. configure_file(data/levels/misc/menu.stl.in ${CMAKE_BINARY_DIR}/data/levels/misc/menu.stl )
  830. ## CPack/Installation-specific stuff
  831. include(InstallRequiredSystemLibraries)
  832. set(DIRS ${Boost_LIBRARY_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/external/squirrel ${CMAKE_CURRENT_BINARY_DIR}/external/tinygettext)
  833. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT DISABLE_CPACK_BUNDLING)
  834. set(INFOPLIST_CFBUNDLEEXECUTABLE "SuperTux")
  835. find_package(png)
  836. foreach (_file ${PNG_LIBRARIES})
  837. get_filename_component(_resolvedFile "${_file}" REALPATH)
  838. get_filename_component(_name "${_file}" NAME)
  839. install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name})
  840. endforeach()
  841. find_package(jpeg)
  842. foreach (_file ${JPEG_LIBRARIES})
  843. get_filename_component(_resolvedFile "${_file}" REALPATH)
  844. get_filename_component(_name "${_file}" NAME)
  845. install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name})
  846. endforeach()
  847. install(CODE "
  848. if(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\" MATCHES \".*\\\\.app.*\")
  849. include(BundleUtilities)
  850. fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")
  851. endif()
  852. ")
  853. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist.in" "${CMAKE_BINARY_DIR}/tools/darwin/info.plist")
  854. set(CPACK_BUNDLE_NAME "SuperTux")
  855. set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/tools/darwin/info.plist")
  856. set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.icns")
  857. set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/startup.sh")
  858. set(CPACK_DMG_VOLUME_NAME "SuperTux ${SUPERTUX_VERSION_STRING}")
  859. set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/dsstore_setup.scpt")
  860. set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/background.png")
  861. endif()
  862. set(CPACK_PACKAGE_NAME "SuperTux")
  863. set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux")
  864. set(CPACK_PACKAGE_VENDOR "SuperTux Devel Team")
  865. set(CPACK_PACKAGE_CONTACT "SuperTux Devel Team <supertux-devel@lists.lethargik.org>")
  866. set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;${CMAKE_BINARY_DIR};/\\\\..*")
  867. set(CPACK_DEBIAN_PACKAGE_NAME "supertux2")
  868. 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)")
  869. 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/")
  870. set(CPACK_DEBIAN_PACKAGE_SECTION "games")
  871. set(CPACK_RPM_PACKAGE_NAME "supertux2")
  872. 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/")
  873. set(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)")
  874. set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade")
  875. set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
  876. set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
  877. set(CPACK_PACKAGE_VERSION_MAJOR ${SUPERTUX_VERSION_MAJOR})
  878. set(CPACK_PACKAGE_VERSION_MINOR ${SUPERTUX_VERSION_MINOR})
  879. if(SUPERTUX_VERSION_TWEAK)
  880. set(CPACK_PACKAGE_VERSION_PATCH "${SUPERTUX_VERSION_PATCH}.${SUPERTUX_VERSION_TWEAK}")
  881. else()
  882. set(CPACK_PACKAGE_VERSION_PATCH ${SUPERTUX_VERSION_PATCH})
  883. endif(SUPERTUX_VERSION_TWEAK)
  884. set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-${SUPERTUX_SYSTEM_NAME}")
  885. set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-Source")
  886. set(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux")
  887. set(CPACK_PACKAGE_EXECUTABLES "supertux2" "SuperTux")
  888. if(WIN32 AND NOT UNIX)
  889. set(CPACK_NSIS_INSTALLED_ICON_NAME "supertux2")
  890. set(CPACK_NSIS_DISPLAY_NAME "SuperTux")
  891. set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
  892. set(CPACK_WIX_PROGRAM_MENU_FOLDER "")
  893. set(CPACK_WIX_UPGRADE_GUID "93E16F4E-0A68-422A-8ADC-47BE5B9433B2")
  894. set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico")
  895. set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/banner.png")
  896. set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/dialog.png")
  897. set(CPACK_GENERATOR WIX)
  898. else(WIN32 AND NOT UNIX)
  899. endif(WIN32 AND NOT UNIX)
  900. include(CPack)
  901. # move some config clutter to the advanced section
  902. mark_as_advanced(
  903. INSTALL_SUBDIR_BIN
  904. INSTALL_SUBDIR_SHARE
  905. INSTALL_SUBDIR_DOC
  906. )
  907. mark_as_advanced(
  908. CMAKE_BACKWARDS_COMPATIBILITY
  909. CMAKE_BUILD_TYPE
  910. CMAKE_INSTALL_PREFIX
  911. EXECUTABLE_OUTPUT_PATH
  912. LIBRARY_OUTPUT_PATH
  913. CMAKE_OSX_ARCHITECTURES
  914. CMAKE_OSX_SYSROOT
  915. )
  916. mark_as_advanced(
  917. APPDATADIR
  918. )
  919. mark_as_advanced(
  920. Boost_INCLUDE_DIR
  921. Boost_LIBRARIES
  922. )
  923. mark_as_advanced(
  924. GLEW_INCLUDE_DIR
  925. GLEW_LIBRARY
  926. )
  927. mark_as_advanced(
  928. SDL2_INCLUDE_DIRS
  929. SDL2_LIBRARIES
  930. )
  931. mark_as_advanced(
  932. SDL2IMAGE_INCLUDE_DIRS
  933. SDL2IMAGE_LIBRARIES
  934. )
  935. mark_as_advanced(
  936. OPENAL_INCLUDE_DIR
  937. OPENAL_LIBRARY
  938. )
  939. mark_as_advanced(
  940. SDL2TTF_INCLUDE_DIRS
  941. SDL2TTF_LIBRARIES
  942. )
  943. mark_as_advanced(
  944. OGG_LIBRARY
  945. VORBISENC_LIBRARY
  946. VORBISFILE_LIBRARY
  947. VORBIS_INCLUDE_DIR
  948. VORBIS_LIBRARY
  949. )
  950. mark_as_advanced(
  951. PHYSFS_INCLUDE_DIR
  952. PHYSFS_LIBRARY
  953. )