2 # SuperTux - root build script
3 # Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
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.
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.
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
25 # Create a directory build/ and change to it. Run
29 # This creates a set of Makefiles to build the project. Run
35 ## Project name to use as command prefix.
39 ## Version, for display in title bar.
40 ## Will add r<revision number> to the end if svnversion is available.
41 SET(SUPERTUX_VERSION "0.3.3-SVN")
43 ### CMake configuration
45 # allow building with CMake 2.6. Set compatibility options. Use some bundled modules as a fallback
46 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
47 IF(COMMAND cmake_policy)
48 CMAKE_POLICY(SET CMP0003 NEW)
49 ENDIF(COMMAND cmake_policy)
51 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/mk/cmake)
54 OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF)
55 SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2")
59 INCLUDE(TestBigEndian)
60 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
62 ## Add lots of dependencies to compiler switches
64 SET(Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0")
65 FIND_PACKAGE(Boost REQUIRED)
66 INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIR})
67 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
69 FIND_PACKAGE(SDL REQUIRED)
70 INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
73 FIND_PACKAGE(SDL_image REQUIRED)
74 INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR})
76 OPTION(ENABLE_OPENGL "Enable OpenGL support" ON)
80 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
86 INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})
90 FIND_PACKAGE(OpenAL REQUIRED)
91 INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
93 FIND_PACKAGE(OggVorbis REQUIRED)
94 INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIR})
96 FIND_PACKAGE(PhysFS REQUIRED)
97 INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR})
101 INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
102 SET(HAVE_LIBCURL TRUE)
105 #FIND_PACKAGE(ICONV REQUIRED)
106 #INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
107 #LINK_LIBRARIES(${ICONV_LIBRARY})
109 ## Find revision of WC
110 MARK_AS_ADVANCED(SVNVERSION_EXECUTABLE)
111 FIND_PROGRAM(SVNVERSION_EXECUTABLE svnversion)
112 IF(SVNVERSION_EXECUTABLE)
113 ADD_CUSTOM_TARGET(svnversion ALL
114 cmake -E echo "#ifndef VERSION_H" > "${CMAKE_BINARY_DIR}/version.h.tmp"
115 COMMAND cmake -E echo "#define VERSION_H" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
116 COMMAND cmake -E echo_append "#define PACKAGE_VERSION \"${SUPERTUX_VERSION} r" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
117 COMMAND svnversion -n ${CMAKE_CURRENT_SOURCE_DIR} >> "${CMAKE_BINARY_DIR}/version.h.tmp"
118 COMMAND cmake -E echo "\"" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
119 COMMAND cmake -E echo "#endif" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
120 COMMAND cmake -E copy_if_different "${CMAKE_BINARY_DIR}/version.h.tmp" "${CMAKE_BINARY_DIR}/version.h"
121 COMMAND cmake -E remove "${CMAKE_BINARY_DIR}/version.h.tmp"
122 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
123 COMMENT "Updating ${CMAKE_BINARY_DIR}/version.h..."
125 ELSE(SVNVERSION_EXECUTABLE)
126 ADD_CUSTOM_TARGET(svnversion ALL
127 cmake -E echo "#ifndef VERSION_H" > "${CMAKE_BINARY_DIR}/version.h.tmp"
128 COMMAND cmake -E echo "#define VERSION_H" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
129 COMMAND cmake -E echo "#define PACKAGE_VERSION \"${SUPERTUX_VERSION}\"" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
130 COMMAND cmake -E echo "#endif" >> "${CMAKE_BINARY_DIR}/version.h.tmp"
131 COMMAND cmake -E copy_if_different "${CMAKE_BINARY_DIR}/version.h.tmp" "${CMAKE_BINARY_DIR}/version.h"
132 COMMAND cmake -E remove "${CMAKE_BINARY_DIR}/version.h.tmp"
133 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
134 COMMENT "Updating ${CMAKE_BINARY_DIR}/version.h..."
136 ENDIF(SVNVERSION_EXECUTABLE)
138 SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/version.h
139 PROPERTIES GENERATED true)
140 SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/main.cpp
141 PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
142 SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/src/supertux/title_screen.cpp
143 PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
144 SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/src/addon/addon_manager.cpp
145 PROPERTIES OBJECT_DEPENDS "${CMAKE_BINARY_DIR}/version.h")
146 ## Check platform-dependent build options
148 INCLUDE(ConfigureChecks)
150 ## Also execute instructions in src/squirrel/CMakeLists.txt
152 ADD_SUBDIRECTORY(external/squirrel)
154 ## Add squirrel lib dir to search path
156 LINK_DIRECTORIES(external/squirrel)
158 ## Some additional include paths
160 include_directories (${CMAKE_BINARY_DIR}/)
161 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src/)
162 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/squirrel/include/)
163 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/tinygettext/)
164 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/findlocale/)
165 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/obstack/)
166 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/external/binreloc/)
168 ## Build list of sources for supertux binary
170 FILE(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
172 FILE(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/main.cpp src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp)
174 FILE(GLOB TINYGETTEXT_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/tinygettext/tinygettext/*.cpp)
175 SET_SOURCE_FILES_PROPERTIES(${TINYGETTEXT_SOURCES_CXX} PROPERTIES COMPILE_DEFINITIONS HAVE_SDL)
178 FILE(GLOB SUPERTUX_OPENGL_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/video/gl/*.cpp)
179 SET(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_OPENGL_SOURCES})
182 ## Build miniswig and generate miniswig wrapper
184 OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG})
186 ADD_SUBDIRECTORY(tools/miniswig)
188 OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.hpp
189 COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${CMAKE_CXX_COMPILER}
190 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
191 COMMAND tools/miniswig/miniswig
192 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
193 DEPENDS tools/miniswig/miniswig
194 IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.interface.hpp
196 ENDIF(GENERATE_WRAPPER)
198 IF(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
199 SET(SUPERTUX_SOURCES_CXX ${SUPERTUX_SOURCES_CXX} ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
200 ENDIF(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scripting/wrapper.cpp)
202 ## Compile everything at once (roughly equivalent to cat *.cpp | gcc)
204 OPTION(COMPILE_AMALGATION "Compile all the files together at once (experimental)" OFF)
205 IF(COMPILE_AMALGATION)
206 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "// Includes all source files of the project\n")
207 FOREACH(ST_FILE ${SUPERTUX_SOURCES_CXX})
208 FILE(RELATIVE_PATH CXX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src "${CMAKE_CURRENT_SOURCE_DIR}/${ST_FILE}")
209 FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp "#include \"${CXX_FILE}\"\n")
211 ## Build instead of CXX sources
212 SET(SUPERTUX_SOURCES_CXX ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
213 ELSE(COMPILE_AMALGATION)
214 IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
215 FILE(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
216 ENDIF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/amalgation.cpp)
217 ENDIF(COMPILE_AMALGATION)
221 OPTION(WERROR "Stop on first compiler warning" OFF)
222 OPTION(WARNINGS "Enable long list of warnings for compiler to check" ${DEBUG})
223 IF(CMAKE_COMPILER_IS_GNUCC)
224 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
225 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g" CACHE STRING "Debug flags")
226 SET(CMAKE_CXX_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
227 SET(CMAKE_C_FLAGS_PROFILE "-pg" CACHE STRING "Profile flags")
228 SET(CMAKE_LD_FLAGS_PROFILE "-lgmon" CACHE STRING "Profile flags")
229 ADD_DEFINITIONS(-Wall -Wextra -funit-at-a-time)
231 ADD_DEFINITIONS(-Werror)
233 REMOVE_DEFINITIONS(-Werror)
236 ADD_DEFINITIONS(-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wconversion -Wundef -Wsign-conversion -Wshadow -Winline -Wunsafe-loop-optimizations -Wfloat-equal -Wswitch-default -Wswitch-enum -Wcast-qual -Wsign-promo -Woverloaded-virtual -Wmissing-format-attribute -Wstrict-overflow=5 -Wformat=2-Weffc++ -Wabi -Wctor-dtor-privacy -Wstrict-null-sentinel -Wno-unused-parameter)
237 # -ansi fails in MinGW
238 # still left: -Wold-style-cast -Wpadded
240 ENDIF(CMAKE_COMPILER_IS_GNUCC)
242 ## If xgettext is available, generate messages.pot for sources
244 OPTION(GENERATE_MESSAGESPOT "Generate messages.pot files" ${DEBUG})
245 IF(GENERATE_MESSAGESPOT)
249 FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
250 IF(NOT XGETTEXT_EXECUTABLE)
251 MESSAGE(STATUS "Warning: xgettext not found - will not update messages.pot")
252 ELSE(NOT XGETTEXT_EXECUTABLE)
253 MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
255 SET(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/data/locale/messages.pot)
257 OUTPUT ${MESSAGES_POT_FILE}
258 COMMAND ${XGETTEXT_EXECUTABLE}
259 ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES_CXX}
260 DEPENDS ${SUPERTUX_SOURCES_CXX}
261 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
262 COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
264 LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
266 FILE(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} data/levels/*)
267 LIST(REMOVE_ITEM SUPERTUX_LEVEL_DIRS "data/levels/.svn")
268 FOREACH(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS})
269 FILE(GLOB SUPERTUX_LEVELS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt)
271 ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4
273 SET(MESSAGES_POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot)
275 OUTPUT ${MESSAGES_POT_FILE}
276 COMMAND ${XGETTEXT_EXECUTABLE}
277 ARGS --keyword="_:1" --language=Lisp --force-po --sort-by-file "--output=${MESSAGES_POT_FILE}" ${SUPERTUX_LEVELS}
278 DEPENDS ${SUPERTUX_LEVELS}
279 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
280 COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
282 LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
283 ENDIF(SUPERTUX_LEVELS)
285 ENDFOREACH(SUPERTUX_LEVEL_DIR)
288 supertux2-messages ALL
289 DEPENDS ${MESSAGES_POT_FILES}
292 ENDIF(NOT XGETTEXT_EXECUTABLE)
293 ENDIF(GENERATE_MESSAGESPOT)
295 ## Some additional compiler switches
296 IF(CMAKE_COMPILER_IS_GNUCC)
297 ADD_DEFINITIONS(-fno-strict-aliasing)
298 ENDIF(CMAKE_COMPILER_IS_GNUCC)
300 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
301 ADD_DEFINITIONS(-DMACOSX)
302 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
305 ## On Windows, add an icon
308 SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
311 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o
312 COMMAND windres.exe -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)
313 SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
315 SET(SUPERTUX_EXE_SRCS ${SUPERTUX_EXE_SRCS} supertux.rc)
319 ## Add binreloc.c if enabled
321 SET(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_SOURCE_DIR}/external/binreloc/binreloc.c)
322 ENDIF(ENABLE_BINRELOC)
325 ## Generate supertux executable in the right place
327 SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
329 ## Add target for supertux binary
331 ADD_EXECUTABLE(supertux2 ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCES_CXX} ${TINYGETTEXT_SOURCES_CXX})
332 ADD_DEPENDENCIES(supertux2 svnversion)
334 ## Link supertux binary with squirrel and other libraries
336 TARGET_LINK_LIBRARIES(supertux2 squirrel)
337 TARGET_LINK_LIBRARIES(supertux2 ${SDL_LIBRARY})
338 TARGET_LINK_LIBRARIES(supertux2 ${SDLIMAGE_LIBRARY})
339 TARGET_LINK_LIBRARIES(supertux2 ${OPENAL_LIBRARY})
340 TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES})
341 TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY})
343 TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY})
344 TARGET_LINK_LIBRARIES(supertux2 ${GLEW_LIBRARY})
347 TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY})
352 IF(WIN32 AND NOT UNIX)
354 SET(INSTALL_SUBDIR_BIN "." CACHE STRING "Installation subdir for binaries")
355 SET(INSTALL_SUBDIR_SHARE "data" CACHE STRING "Installation subdir for data")
356 SET(INSTALL_SUBDIR_DOC "." CACHE STRING "Installation subdir for docs")
358 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SDL.dll
359 ${CMAKE_CURRENT_SOURCE_DIR}/SDL_image.dll
360 ${CMAKE_CURRENT_SOURCE_DIR}/iconv.dll
361 ${CMAKE_CURRENT_SOURCE_DIR}/libogg-0.dll
362 ${CMAKE_CURRENT_SOURCE_DIR}/libphysfs-1-0-0.dll
363 ${CMAKE_CURRENT_SOURCE_DIR}/OpenAl32.dll
364 ${CMAKE_CURRENT_SOURCE_DIR}/wrap_oal.dll
365 ${CMAKE_CURRENT_SOURCE_DIR}/libcurl-4.dll DESTINATION ${INSTALL_SUBDIR_BIN})
367 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.png ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".")
369 ELSE(WIN32 AND NOT UNIX)
370 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
372 SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS" CACHE STRING "Installation subdir for binaries")
373 SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data" CACHE STRING "Installation subdir for data")
374 SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources" CACHE STRING "Installation subdir for docs")
376 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
378 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/")
380 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
382 SET(INSTALL_SUBDIR_BIN "games" CACHE STRING "Installation subdir for binaries")
383 SET(INSTALL_SUBDIR_SHARE "share/games/supertux2" CACHE STRING "Installation subdir for data")
384 SET(INSTALL_SUBDIR_DOC "share/doc/supertux2" CACHE STRING "Installation subdir for docs")
386 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
388 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/")
390 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
391 ENDIF(WIN32 AND NOT UNIX)
393 INSTALL(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN})
395 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/INSTALL ${CMAKE_CURRENT_SOURCE_DIR}/README ${CMAKE_CURRENT_SOURCE_DIR}/COPYING ${CMAKE_CURRENT_SOURCE_DIR}/WHATSNEW.txt DESTINATION ${INSTALL_SUBDIR_DOC})
397 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/credits.txt DESTINATION ${INSTALL_SUBDIR_SHARE})
399 INSTALL(DIRECTORY data/images
407 DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
409 ## Create config.h now that INSTALL_SUBDIR_* have been set.
411 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
414 ## CPack/Installation-specific stuff
416 INCLUDE(InstallRequiredSystemLibraries)
417 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux")
418 SET(CPACK_PACKAGE_VENDOR "SuperTux Devel Team")
419 SET(CPACK_PACKAGE_CONTACT "SuperTux Devel Team <supertux-devel@lists.lethargik.org>")
420 SET(CPACK_DEBIAN_PACKAGE_NAME "supertux2")
421 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)")
422 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/")
423 SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
424 SET(CPACK_RPM_PACKAGE_NAME "supertux2")
425 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/")
426 SET(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)")
427 SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade")
428 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
429 # The OS X PackageMaker doesn't seem to like files with no extension
430 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
431 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
432 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
433 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
434 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
435 SET(CPACK_PACKAGE_VERSION_MINOR "3")
436 SET(CPACK_PACKAGE_VERSION_PATCH "2-SVN")
437 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
438 SET(CPACK_PACKAGE_EXECUTABLES "..\\\\supertux2" "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
439 IF(WIN32 AND NOT UNIX)
440 SET(CPACK_NSIS_INSTALLED_ICON_NAME "..\\\\supertux2")
441 SET(CPACK_NSIS_DISPLAY_NAME "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
442 ELSE(WIN32 AND NOT UNIX)
443 ENDIF(WIN32 AND NOT UNIX)
446 # move some config clutter to the advanced section
454 CMAKE_BACKWARDS_COMPATIBILITY
457 EXECUTABLE_OUTPUT_PATH
459 CMAKE_OSX_ARCHITECTURES