Ice blocks (graphics are placeholders)
[supertux.git] / CMakeLists.txt
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
21 #
22 # INSTRUCTIONS:
23 # -------------
24 #
25 # Create a directory build/ and change to it. Run
26 #
27 #   cmake ..
28 #
29 # This creates a set of Makefiles to build the project. Run
30 #
31 #   make
32 #
33
34
35 ## Project name to use as command prefix
36
37 PROJECT(SUPERTUX)
38
39
40 ### CMake configuration
41
42 # allow building with old CMake. Set compatibility options. Use some bundled modules as a fallback
43 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
44 IF(COMMAND cmake_policy)
45         CMAKE_POLICY(SET CMP0003 NEW)
46 ENDIF(COMMAND cmake_policy)
47
48 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SUPERTUX_SOURCE_DIR}/mk/cmake)
49
50 # move some config clutter to the advanced section
51 MARK_AS_ADVANCED(
52         CMAKE_BACKWARDS_COMPATIBILITY
53         CMAKE_BUILD_TYPE
54         CMAKE_INSTALL_PREFIX
55         EXECUTABLE_OUTPUT_PATH
56         LIBRARY_OUTPUT_PATH
57         CMAKE_OSX_ARCHITECTURES
58         CMAKE_OSX_SYSROOT
59 )
60
61 ## For autopackage
62 MARK_AS_ADVANCED(
63         ENABLE_BINRELOC
64         APPDATADIR
65 )
66 OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF)
67 SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2")
68
69 ## Check endianess
70
71 INCLUDE(TestBigEndian)
72 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
73
74 ## Add lots of dependencies to compiler switches
75
76 FIND_PACKAGE(SDL REQUIRED)
77 MARK_AS_ADVANCED(
78         SDLMAIN_LIBRARY
79         SDL_INCLUDE_DIR
80         SDL_LIBRARY
81 )
82 INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
83
84 FIND_PACKAGE(SDL_image REQUIRED)
85 MARK_AS_ADVANCED(
86         SDLIMAGE_INCLUDE_DIR
87         SDLIMAGE_LIBRARY
88 )
89 INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR})
90
91 OPTION(ENABLE_OPENGL "Enable OpenGL support" ON)
92 IF(ENABLE_OPENGL)
93   FIND_PACKAGE(OpenGL)
94   IF(${OPENGL_FOUND} STREQUAL "YES")
95     INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
96     SET(HAVE_OPENGL TRUE)
97   ENDIF(${OPENGL_FOUND} STREQUAL "YES")
98 ENDIF(ENABLE_OPENGL)
99
100 FIND_PACKAGE(OpenAL REQUIRED)
101 MARK_AS_ADVANCED(
102         OPENAL_INCLUDE_DIR
103         OPENAL_LIBRARY
104 )
105 INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
106
107 FIND_PACKAGE(OggVorbis REQUIRED)
108 MARK_AS_ADVANCED(
109         OGG_LIBRARY
110         VORBISENC_LIBRARY
111         VORBISFILE_LIBRARY
112         VORBIS_INCLUDE_DIR
113         VORBIS_LIBRARY
114 )
115 INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIR})
116
117 FIND_PACKAGE(PhysFS REQUIRED)
118 MARK_AS_ADVANCED(
119         PHYSFS_INCLUDE_DIR
120         PHYSFS_LIBRARY
121 )
122 INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR})
123
124 FIND_PACKAGE(CURL)
125 IF(CURL_FOUND)
126   INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
127   SET(HAVE_LIBCURL TRUE)
128 ENDIF(CURL_FOUND)
129
130 #FIND_PACKAGE(ICONV REQUIRED)
131 #INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
132 #LINK_LIBRARIES(${ICONV_LIBRARY})
133
134 ## Find revision of WC
135 MARK_AS_ADVANCED(SVNVERSION_EXECUTABLE)
136 FIND_PROGRAM(SVNVERSION_EXECUTABLE svnversion)
137 IF(SVNVERSION_EXECUTABLE)
138   EXECUTE_PROCESS(COMMAND svnversion -n ${SUPERTUX_SOURCE_DIR}
139                   OUTPUT_VARIABLE SUPERTUX_WC_REVISION)
140   SET(REVISION " r${SUPERTUX_WC_REVISION}")
141 ENDIF(SVNVERSION_EXECUTABLE)
142
143 ## Check platform-dependent build options
144
145 INCLUDE(ConfigureChecks)
146
147 ## Create config.h
148
149 configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
150 include_directories (${CMAKE_BINARY_DIR}/)
151
152 ## Also execute instructions in src/squirrel/CMakeLists.txt
153
154 ADD_SUBDIRECTORY(src/squirrel)
155
156 ## Add squirrel lib dir to search path
157
158 LINK_DIRECTORIES(src/squirrel)
159
160 ## Some additional include paths
161
162 include_directories (${SUPERTUX_SOURCE_DIR}/src/)
163 include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/include/)
164
165 ## Build list of sources for supertux binary
166
167 FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/*/*.cpp src/obstack/*.c)
168
169 ## Precompile "a few" headers in GCC
170 OPTION(PRECOMPILE_HEADERS "Precompile headers (experimental)" OFF)
171 IF(PRECOMPILE_HEADERS)
172   FILE(GLOB PRECOMPILED_HEADERS RELATIVE ${SUPERTUX_SOURCE_DIR} src/badguy/badguy.hpp
173            src/scripting/wrapper.hpp src/video/*.hpp src/math/*.hpp)
174   FILE(WRITE ${SUPERTUX_BINARY_DIR}/precompile.hh "// Precompiled headers\n")
175   FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#ifndef __SUPERTUX_PRECOMPILED_HEADER\n")
176   FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#define __SUPERTUX_PRECOMPILED_HEADER\n")
177   FOREACH(PRECOMPILED_HEADER ${PRECOMPILED_HEADERS})
178     FILE(RELATIVE_PATH PRECOMPILED_HEADER ${SUPERTUX_SOURCE_DIR}/src "${SUPERTUX_SOURCE_DIR}/${PRECOMPILED_HEADER}")
179     FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#include \"${PRECOMPILED_HEADER}\"\n")
180   ENDFOREACH(PRECOMPILED_HEADER)
181   FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#endif /*__SUPERTUX_PRECOMPILED_HEADER*/\n")
182   ADD_CUSTOM_COMMAND(
183     OUTPUT ${SUPERTUX_BINARY_DIR}/precompile.hh.gch
184     COMMAND ${CMAKE_CXX_COMPILER} -x "c++-header" $(CXX_FLAGS) ${SUPERTUX_BINARY_DIR}/precompile.hh
185     DEPENDS ${PRECOMPILED_HEADERS}
186     COMMENT "Building precompiled header..."
187   )
188   ## Make certain it is built
189   SET(SUPERTUX_SOURCES ${SUPERTUX_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES})
190   SET(CMAKE_CXX_FLAGS "-include ${SUPERTUX_BINARY_DIR}/precompile.hh" ${CMAKE_CXX_FLAGS})
191 ELSE(PRECOMPILE_HEADERS)
192   IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh)
193     FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh)
194   ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh)
195   IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch)
196     FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh.gch)
197   ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch)
198 ENDIF(PRECOMPILE_HEADERS)
199
200
201 ## Debug options
202
203 OPTION(WERROR "Stops on first compiler warning in debug mode" ON)
204 IF(CMAKE_COMPILER_IS_GNUCC)
205   ADD_DEFINITIONS(-Wall -Wextra)
206   SET(CMAKE_CXX_FLAGS_PROFILE "-pg")
207   SET(CMAKE_C_FLAGS_PROFILE "-pg")
208   SET(CMAKE_LD_FLAGS_PROFILE "-pg")
209   IF(WERROR)
210     ADD_DEFINITIONS(-Werror)
211   ENDIF(WERROR)
212 ENDIF(CMAKE_COMPILER_IS_GNUCC)
213
214 ## Add in squirrel debug stuff
215
216 OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" OFF)
217 IF(ENABLE_SQDBG)
218   include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/)
219   FILE(GLOB SQDBG_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/squirrel/sqdbg/*.cpp)
220   SET(SUPERTUX_SOURCES ${SQDBG_SOURCES} ${SUPERTUX_SOURCES})
221 ENDIF(ENABLE_SQDBG)
222
223 ## Build miniswig and generate miniswig wrapper
224
225 OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG})
226 IF(GENERATE_WRAPPER)
227   ADD_SUBDIRECTORY(tools/miniswig)
228   FILE(GLOB GENERATE_WRAPPER_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/scripting/*.?pp)
229   LIST(REMOVE_ITEM GENERATE_WRAPPER_SOURCES "src/scripting/wrapper.cpp" "src/scripting/wrapper.hpp")
230   ADD_CUSTOM_COMMAND(
231     OUTPUT ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp
232     COMMAND cd ${SUPERTUX_SOURCE_DIR} && ${CMAKE_CXX_COMPILER}
233     ARGS -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o ${SUPERTUX_BINARY_DIR}/miniswig.tmp
234     COMMAND tools/miniswig/miniswig
235     ARGS --input miniswig.tmp --output-cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp --output-hpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp --module supertux --select-namespace Scripting
236     DEPENDS ${GENERATE_WRAPPER_SOURCES} tools/miniswig/miniswig
237   )
238 ENDIF(GENERATE_WRAPPER)
239
240 IF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp)
241   SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp)
242 ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp)
243
244 ## If xgettext is available, generate messages.pot for sources
245
246 OPTION(GENERATE_MESSAGESPOT "Generate messages.pot files" ${DEBUG})
247 IF(GENERATE_MESSAGESPOT)
248   MARK_AS_ADVANCED(
249     XGETTEXT_EXECUTABLE
250   )
251   FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
252   IF(NOT XGETTEXT_EXECUTABLE)
253     MESSAGE(STATUS "Warning: xgettext not found - will not update messages.pot")
254   ELSE(NOT XGETTEXT_EXECUTABLE)
255     MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
256
257     SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/data/locale/messages.pot)
258     ADD_CUSTOM_COMMAND(
259       OUTPUT ${MESSAGES_POT_FILE}
260       COMMAND ${XGETTEXT_EXECUTABLE}
261       ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES}
262       DEPENDS ${SUPERTUX_SOURCES}
263       WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR}
264       COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
265     )
266     LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
267
268     FILE(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${SUPERTUX_SOURCE_DIR} data/levels/*)
269     LIST(REMOVE_ITEM SUPERTUX_LEVEL_DIRS "data/levels/.svn")
270     FOREACH(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS})
271       FILE(GLOB SUPERTUX_LEVELS RELATIVE ${SUPERTUX_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt)
272
273       ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4
274       IF(SUPERTUX_LEVELS)
275       SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot)
276       ADD_CUSTOM_COMMAND(
277         OUTPUT ${MESSAGES_POT_FILE}
278         COMMAND ${XGETTEXT_EXECUTABLE}
279         ARGS --keyword="_:1" --language=Lisp --sort-by-file --output=${MESSAGES_POT_FILE} ${SUPERTUX_LEVELS}
280         DEPENDS ${SUPERTUX_LEVELS}
281         WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR}
282         COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
283       )
284       LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE})
285       ENDIF(SUPERTUX_LEVELS)
286
287     ENDFOREACH(SUPERTUX_LEVEL_DIR)
288
289     ADD_CUSTOM_TARGET(
290       supertux2-messages ALL 
291       DEPENDS ${MESSAGES_POT_FILES}
292     )
293
294   ENDIF(NOT XGETTEXT_EXECUTABLE)
295 ENDIF(GENERATE_MESSAGESPOT)
296
297 ## Some additional compiler switches
298 IF(CMAKE_COMPILER_IS_GNUCC)
299   ADD_DEFINITIONS(-fno-strict-aliasing)
300 ENDIF(CMAKE_COMPILER_IS_GNUCC)
301
302 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
303   ADD_DEFINITIONS(-DMACOSX)
304 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
305
306
307 ## On Windows, add an icon
308
309 IF(WIN32)
310   SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
311   IF(MINGW)
312     ADD_CUSTOM_COMMAND(
313     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o
314     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)
315     SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
316   ELSE(MINGW)
317     SET(SUPERTUX_EXE_SRCS ${SUPERTUX_EXE_SRCS} supertux.rc)
318   ENDIF(MINGW)
319 ENDIF(WIN32)
320
321 ## Add binreloc.c if enabled
322 IF(ENABLE_BINRELOC)
323   SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/binreloc/binreloc.c)
324 ENDIF(ENABLE_BINRELOC)
325
326
327 ## Generate supertux executable in the right place
328
329 SET(EXECUTABLE_OUTPUT_PATH ${SUPERTUX_SOURCE_DIR})
330
331 ## Add target for supertux binary
332
333 ADD_EXECUTABLE(supertux2 ${SUPERTUX_SOURCES})
334
335 ## Link supertux binary with squirrel and other libraries
336
337 TARGET_LINK_LIBRARIES(supertux2 squirrel)
338 TARGET_LINK_LIBRARIES(supertux2 ${SDL_LIBRARY})
339 TARGET_LINK_LIBRARIES(supertux2 ${SDLIMAGE_LIBRARY})
340 TARGET_LINK_LIBRARIES(supertux2 ${OPENAL_LIBRARY})
341 TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES})
342 TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY})
343 IF(HAVE_OPENGL)
344     TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY})
345 ENDIF(HAVE_OPENGL)
346 IF(HAVE_LIBCURL)
347   TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY})
348 ENDIF(HAVE_LIBCURL)
349
350 ## Install stuff
351
352 IF(WIN32 AND NOT UNIX)
353
354   SET(INSTALL_SUBDIR_BIN ".")
355   SET(INSTALL_SUBDIR_SHARE "data/")
356   SET(INSTALL_SUBDIR_DOC ".")
357
358   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL.dll DESTINATION ${INSTALL_SUBDIR_BIN})
359   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL_image.dll DESTINATION ${INSTALL_SUBDIR_BIN})
360   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/iconv.dll DESTINATION ${INSTALL_SUBDIR_BIN})
361   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libogg-0.dll DESTINATION ${INSTALL_SUBDIR_BIN})
362   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libphysfs-1-0-0.dll DESTINATION ${INSTALL_SUBDIR_BIN})
363   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/OpenAl32.dll DESTINATION ${INSTALL_SUBDIR_BIN})
364   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/wrap_oal.dll DESTINATION ${INSTALL_SUBDIR_BIN})
365   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libcurl-4.dll DESTINATION ${INSTALL_SUBDIR_BIN})
366
367   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".")
368
369 ELSE(WIN32 AND NOT UNIX)
370 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
371
372   SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/")
373   SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/")
374   SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/")
375
376   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/")
377
378   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.icns DESTINATION "SuperTux.app/Contents/Resources/")
379
380 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
381
382   SET(INSTALL_SUBDIR_BIN "games/")
383   SET(INSTALL_SUBDIR_SHARE "share/games/supertux2/")
384   SET(INSTALL_SUBDIR_DOC "share/doc/supertux2/")
385
386   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications")
387
388   INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION "share/pixmaps/")
389
390 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
391 ENDIF(WIN32 AND NOT UNIX)
392
393 INSTALL(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN})
394
395 INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/INSTALL ${SUPERTUX_SOURCE_DIR}/README ${SUPERTUX_SOURCE_DIR}/COPYING ${SUPERTUX_SOURCE_DIR}/WHATSNEW.txt DESTINATION ${INSTALL_SUBDIR_DOC})
396
397 INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/credits.txt DESTINATION ${INSTALL_SUBDIR_SHARE})
398 INSTALL(DIRECTORY data/images DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
399 INSTALL(DIRECTORY data/fonts DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
400 INSTALL(DIRECTORY data/levels DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
401 INSTALL(DIRECTORY data/music DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
402 INSTALL(DIRECTORY data/scripts DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
403 INSTALL(DIRECTORY data/speech DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
404 INSTALL(DIRECTORY data/sounds DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
405 INSTALL(DIRECTORY data/locale DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE)
406
407
408 ## CPack/Installation-specific stuff
409
410 INCLUDE(InstallRequiredSystemLibraries)
411 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux")
412 SET(CPACK_PACKAGE_VENDOR "SuperTux Devel Team")
413 SET(CPACK_PACKAGE_CONTACT "SuperTux Devel Team <supertux-devel@lists.lethargik.org>")
414 SET(CPACK_DEBIAN_PACKAGE_NAME "supertux2")
415 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)")
416 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/")
417 SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
418 SET(CPACK_RPM_PACKAGE_NAME "supertux2")
419 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/")
420 SET(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)")
421 SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade")
422 IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
423   # The OS X PackageMaker doesn't seem to like files with no extension
424 ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
425   SET(CPACK_PACKAGE_DESCRIPTION_FILE "${SUPERTUX_SOURCE_DIR}/README")
426   SET(CPACK_RESOURCE_FILE_LICENSE "${SUPERTUX_SOURCE_DIR}/COPYING")
427 ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
428 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
429 SET(CPACK_PACKAGE_VERSION_MINOR "3")
430 SET(CPACK_PACKAGE_VERSION_PATCH "2-SVN")
431 SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
432 SET(CPACK_PACKAGE_EXECUTABLES "..\\\\supertux2" "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
433 IF(WIN32 AND NOT UNIX)
434   SET(CPACK_NSIS_INSTALLED_ICON_NAME "..\\\\supertux2")
435   SET(CPACK_NSIS_DISPLAY_NAME "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
436 ELSE(WIN32 AND NOT UNIX)
437 ENDIF(WIN32 AND NOT UNIX)
438 INCLUDE(CPack)
439