From: Tim Goya Date: Wed, 22 Oct 2008 18:27:57 +0000 (+0000) Subject: change eol-style to native on CMakeLists.txt X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6103be8899c14076d5f8318857923a087e900db6;p=supertux.git change eol-style to native on CMakeLists.txt SVN-Revision: 5800 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b70a71b..b8b3c41e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,443 +1,443 @@ -# -# SuperTux - root build script -# Copyright (C) 2006 Christoph Sommer -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - - -# -# INSTRUCTIONS: -# ------------- -# -# Create a directory build/ and change to it. Run -# -# cmake .. -# -# This creates a set of Makefiles to build the project. Run -# -# make -# - - -## Project name to use as command prefix - -PROJECT(SUPERTUX) - - -### CMake configuration - -# allow building with old CMake. Use some bundled modules as a fallback -CMAKE_MINIMUM_REQUIRED(VERSION 2.4) -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SUPERTUX_SOURCE_DIR}/mk/cmake) - -# move some config clutter to the advanced section -MARK_AS_ADVANCED( - CMAKE_BACKWARDS_COMPATIBILITY - CMAKE_BUILD_TYPE - CMAKE_INSTALL_PREFIX - EXECUTABLE_OUTPUT_PATH - LIBRARY_OUTPUT_PATH - CMAKE_OSX_ARCHITECTURES - CMAKE_OSX_SYSROOT -) - -## For autopackage -MARK_AS_ADVANCED( - ENABLE_BINRELOC - APPDATADIR -) -OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF) -SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2") - -## Check endianess - -INCLUDE(TestBigEndian) -TEST_BIG_ENDIAN(WORDS_BIGENDIAN) - -## Add lots of dependencies to compiler switches - -FIND_PACKAGE(SDL REQUIRED) -MARK_AS_ADVANCED( - SDLMAIN_LIBRARY - SDL_INCLUDE_DIR - SDL_LIBRARY -) -INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) - -FIND_PACKAGE(SDL_image REQUIRED) -MARK_AS_ADVANCED( - SDLIMAGE_INCLUDE_DIR - SDLIMAGE_LIBRARY -) -INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR}) - -OPTION(ENABLE_OPENGL "Enable OpenGL support" ON) -IF(ENABLE_OPENGL) - FIND_PACKAGE(OpenGL) - IF(${OPENGL_FOUND} STREQUAL "YES") - INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) - SET(HAVE_OPENGL TRUE) - ENDIF(${OPENGL_FOUND} STREQUAL "YES") -ENDIF(ENABLE_OPENGL) - -FIND_PACKAGE(OpenAL REQUIRED) -MARK_AS_ADVANCED( - OPENAL_INCLUDE_DIR - OPENAL_LIBRARY -) -INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) - -FIND_PACKAGE(OggVorbis REQUIRED) -MARK_AS_ADVANCED( - OGG_LIBRARY - VORBISENC_LIBRARY - VORBISFILE_LIBRARY - VORBIS_INCLUDE_DIR - VORBIS_LIBRARY -) -INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIR}) - -FIND_PACKAGE(PhysFS REQUIRED) -MARK_AS_ADVANCED( - PHYSFS_INCLUDE_DIR - PHYSFS_LIBRARY -) -INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR}) - -FIND_PACKAGE(CURL) -IF(CURL_FOUND) - INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) - SET(HAVE_LIBCURL TRUE) -ENDIF(CURL_FOUND) - -#FIND_PACKAGE(ICONV REQUIRED) -#INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) -#LINK_LIBRARIES(${ICONV_LIBRARY}) - -## Find revision of WC -FIND_PACKAGE(Subversion) -IF(Subversion_FOUND) - Subversion_WC_INFO(${SUPERTUX_SOURCE_DIR} SUPERTUX) - SET(REVISION " r${SUPERTUX_WC_REVISION}") -ENDIF(Subversion_FOUND) - -## Check platform-dependent build options - -INCLUDE(ConfigureChecks) - -## Create config.h - -configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h ) -include_directories (${CMAKE_BINARY_DIR}/) - -## Also execute instructions in src/squirrel/CMakeLists.txt - -ADD_SUBDIRECTORY(src/squirrel) - -## Add squirrel lib dir to search path - -LINK_DIRECTORIES(src/squirrel) - -## Some additional include paths - -include_directories (${SUPERTUX_SOURCE_DIR}/src/) -include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/include/) - -## Build list of sources for supertux binary - -FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/*/*.cpp src/obstack/*.c) - -## Precompile "a few" headers in GCC -OPTION(PRECOMPILE_HEADERS "Precompile headers (experimental)" OFF) -IF(PRECOMPILE_HEADERS) - FILE(GLOB PRECOMPILED_HEADERS RELATIVE ${SUPERTUX_SOURCE_DIR} src/badguy/badguy.hpp - src/scripting/wrapper.hpp src/video/*.hpp src/math/*.hpp) - FILE(WRITE ${SUPERTUX_BINARY_DIR}/precompile.hh "// Precompiled headers\n") - FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#ifndef __SUPERTUX_PRECOMPILED_HEADER\n") - FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#define __SUPERTUX_PRECOMPILED_HEADER\n") - FOREACH(PRECOMPILED_HEADER ${PRECOMPILED_HEADERS}) - FILE(RELATIVE_PATH PRECOMPILED_HEADER ${SUPERTUX_SOURCE_DIR}/src "${SUPERTUX_SOURCE_DIR}/${PRECOMPILED_HEADER}") - FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#include \"${PRECOMPILED_HEADER}\"\n") - ENDFOREACH(PRECOMPILED_HEADER) - FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#endif /*__SUPERTUX_PRECOMPILED_HEADER*/\n") - ADD_CUSTOM_COMMAND( - OUTPUT ${SUPERTUX_BINARY_DIR}/precompile.hh.gch - COMMAND ${CMAKE_CXX_COMPILER} -x "c++-header" $(CXX_FLAGS) ${SUPERTUX_BINARY_DIR}/precompile.hh - DEPENDS ${PRECOMPILED_HEADERS} - COMMENT "Building precompiled header..." - ) - ## Make certain it is built - SET(SUPERTUX_SOURCES ${SUPERTUX_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES}) - SET(CMAKE_CXX_FLAGS "-include ${SUPERTUX_BINARY_DIR}/precompile.hh" ${CMAKE_CXX_FLAGS}) -ELSE(PRECOMPILE_HEADERS) - IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh) - FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh) - ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh) - IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) - FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) - ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) -ENDIF(PRECOMPILE_HEADERS) - - -## Debug options - -OPTION(DEBUG "Build with debugging options" OFF) -OPTION(PROFILE "Build with profiling information" OFF) -OPTION(WERROR "Stops on first compiler warning in debug mode" ON) -IF(CMAKE_COMPILER_IS_GNUCC) - ADD_DEFINITIONS(-Wall -W) - IF (DEBUG) - REMOVE_DEFINITIONS(-O2) - ADD_DEFINITIONS(-O0 -g) - IF(WERROR) - ADD_DEFINITIONS(-Werror) - ENDIF(WERROR) - ELSE (DEBUG) - ADD_DEFINITIONS(-O2) - REMOVE_DEFINITIONS(-O0 -g) - ENDIF (DEBUG) - IF (PROFILE) - ADD_DEFINITIONS(-pg) - ELSE (PROFILE) - REMOVE_DEFINITIONS(-pg) - ENDIF (PROFILE) -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -## Add in squirrel debug stuff - -OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" OFF) -IF(ENABLE_SQDBG) - include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/) - FILE(GLOB SQDBG_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/squirrel/sqdbg/*.cpp) - SET(SUPERTUX_SOURCES ${SQDBG_SOURCES} ${SUPERTUX_SOURCES}) -ENDIF(ENABLE_SQDBG) - -## Build miniswig and generate miniswig wrapper - -OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG}) -IF(GENERATE_WRAPPER) - ADD_SUBDIRECTORY(tools/miniswig) - FILE(GLOB GENERATE_WRAPPER_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/scripting/*.?pp) - LIST(REMOVE_ITEM GENERATE_WRAPPER_SOURCES "src/scripting/wrapper.cpp" "src/scripting/wrapper.hpp") - ADD_CUSTOM_COMMAND( - OUTPUT ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp - COMMAND cd ${SUPERTUX_SOURCE_DIR} && ${CMAKE_CXX_COMPILER} - ARGS -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o ${SUPERTUX_BINARY_DIR}/miniswig.tmp - COMMAND tools/miniswig/miniswig - 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 - DEPENDS ${GENERATE_WRAPPER_SOURCES} tools/miniswig/miniswig - ) -ENDIF(GENERATE_WRAPPER) - -IF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) -ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) - -## If xgettext is available, generate messages.pot for sources - -OPTION(GENERATE_MESSAGESPOT "Generate messages.pot files" ${DEBUG}) -IF(GENERATE_MESSAGESPOT) - MARK_AS_ADVANCED( - XGETTEXT_EXECUTABLE - ) - FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext) - IF(NOT XGETTEXT_EXECUTABLE) - MESSAGE(STATUS "Warning: xgettext not found - will not update messages.pot") - ELSE(NOT XGETTEXT_EXECUTABLE) - MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}") - - SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/data/locale/messages.pot) - ADD_CUSTOM_COMMAND( - OUTPUT ${MESSAGES_POT_FILE} - COMMAND ${XGETTEXT_EXECUTABLE} - ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES} - DEPENDS ${SUPERTUX_SOURCES} - WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR} - COMMENT "Generating POT file ${MESSAGES_POT_FILE}" - ) - LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE}) - - FILE(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${SUPERTUX_SOURCE_DIR} data/levels/*) - LIST(REMOVE_ITEM SUPERTUX_LEVEL_DIRS "data/levels/.svn") - FOREACH(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS}) - FILE(GLOB SUPERTUX_LEVELS RELATIVE ${SUPERTUX_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt) - - ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4 - IF(SUPERTUX_LEVELS) - SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot) - ADD_CUSTOM_COMMAND( - OUTPUT ${MESSAGES_POT_FILE} - COMMAND ${XGETTEXT_EXECUTABLE} - ARGS --keyword="_:1" --language=Lisp --sort-by-file --output=${MESSAGES_POT_FILE} ${SUPERTUX_LEVELS} - DEPENDS ${SUPERTUX_LEVELS} - WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR} - COMMENT "Generating POT file ${MESSAGES_POT_FILE}" - ) - LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE}) - ENDIF(SUPERTUX_LEVELS) - - ENDFOREACH(SUPERTUX_LEVEL_DIR) - - ADD_CUSTOM_TARGET( - supertux2-messages ALL - DEPENDS ${MESSAGES_POT_FILES} - ) - - ENDIF(NOT XGETTEXT_EXECUTABLE) -ENDIF(GENERATE_MESSAGESPOT) - -## Some additional compiler switches -IF(CMAKE_COMPILER_IS_GNUCC) - ADD_DEFINITIONS(-fno-strict-aliasing) -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - ADD_DEFINITIONS(-DMACOSX) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - - -## On Windows, add an icon - -IF(WIN32) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.rc) - IF(MINGW) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o - 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) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o) - ELSE(MINGW) - SET(SUPERTUX_EXE_SRCS ${SUPERTUX_EXE_SRCS} supertux.rc) - ENDIF(MINGW) -ENDIF(WIN32) - -## Add binreloc.c if enabled -IF(ENABLE_BINRELOC) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/binreloc/binreloc.c) -ENDIF(ENABLE_BINRELOC) - - -## Generate supertux executable in the right place - -SET(EXECUTABLE_OUTPUT_PATH ${SUPERTUX_SOURCE_DIR}) - -## Add target for supertux binary - -ADD_EXECUTABLE(supertux2 ${SUPERTUX_SOURCES}) - -## Link supertux binary with squirrel and other libraries - -TARGET_LINK_LIBRARIES(supertux2 squirrel) -TARGET_LINK_LIBRARIES(supertux2 ${SDL_LIBRARY}) -TARGET_LINK_LIBRARIES(supertux2 ${SDLIMAGE_LIBRARY}) -TARGET_LINK_LIBRARIES(supertux2 ${OPENAL_LIBRARY}) -TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES}) -TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY}) -IF(HAVE_OPENGL) - TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY}) -ENDIF(HAVE_OPENGL) -IF(HAVE_LIBCURL) - TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY}) -ENDIF(HAVE_LIBCURL) - -## Install stuff - -IF(WIN32 AND NOT UNIX) - - SET(INSTALL_SUBDIR_BIN ".") - SET(INSTALL_SUBDIR_SHARE "data/") - SET(INSTALL_SUBDIR_DOC ".") - - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL_image.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/iconv.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libogg-0.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libphysfs-1-0-0.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/OpenAl32.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/wrap_oal.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libcurl-4.dll DESTINATION ${INSTALL_SUBDIR_BIN}) - - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".") - -ELSE(WIN32 AND NOT UNIX) -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - - SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/") - SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/") - SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/") - - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/") - - 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/") - -ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - - SET(INSTALL_SUBDIR_BIN "games/") - SET(INSTALL_SUBDIR_SHARE "share/games/supertux2/") - SET(INSTALL_SUBDIR_DOC "share/doc/supertux2/") - - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications") - - INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION "share/pixmaps/") - -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -ENDIF(WIN32 AND NOT UNIX) - -INSTALL(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN}) - -INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/INSTALL ${SUPERTUX_SOURCE_DIR}/README ${SUPERTUX_SOURCE_DIR}/COPYING ${SUPERTUX_SOURCE_DIR}/WHATSNEW.txt DESTINATION ${INSTALL_SUBDIR_DOC}) - -INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/credits.txt DESTINATION ${INSTALL_SUBDIR_SHARE}) -INSTALL(DIRECTORY data/images DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/levels DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/music DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/scripts DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/speech DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/sounds DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) -INSTALL(DIRECTORY data/locale DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) - - -## CPack/Installation-specific stuff - -INCLUDE(InstallRequiredSystemLibraries) -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux") -SET(CPACK_PACKAGE_VENDOR "SuperTux Devel Team") -SET(CPACK_PACKAGE_CONTACT "SuperTux Devel Team ") -SET(CPACK_DEBIAN_PACKAGE_NAME "supertux2") -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)") -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/") -SET(CPACK_DEBIAN_PACKAGE_SECTION "games") -SET(CPACK_RPM_PACKAGE_NAME "supertux2") -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/") -SET(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)") -SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade") -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - # The OS X PackageMaker doesn't seem to like files with no extension -ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET(CPACK_PACKAGE_DESCRIPTION_FILE "${SUPERTUX_SOURCE_DIR}/README") - SET(CPACK_RESOURCE_FILE_LICENSE "${SUPERTUX_SOURCE_DIR}/COPYING") -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -SET(CPACK_PACKAGE_VERSION_MAJOR "0") -SET(CPACK_PACKAGE_VERSION_MINOR "3") -SET(CPACK_PACKAGE_VERSION_PATCH "2-SVN") -SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") -SET(CPACK_PACKAGE_EXECUTABLES "..\\\\supertux2" "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") -IF(WIN32 AND NOT UNIX) - SET(CPACK_NSIS_INSTALLED_ICON_NAME "..\\\\supertux2") - SET(CPACK_NSIS_DISPLAY_NAME "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") -ELSE(WIN32 AND NOT UNIX) -ENDIF(WIN32 AND NOT UNIX) -INCLUDE(CPack) - +# +# SuperTux - root build script +# Copyright (C) 2006 Christoph Sommer +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + +# +# INSTRUCTIONS: +# ------------- +# +# Create a directory build/ and change to it. Run +# +# cmake .. +# +# This creates a set of Makefiles to build the project. Run +# +# make +# + + +## Project name to use as command prefix + +PROJECT(SUPERTUX) + + +### CMake configuration + +# allow building with old CMake. Use some bundled modules as a fallback +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SUPERTUX_SOURCE_DIR}/mk/cmake) + +# move some config clutter to the advanced section +MARK_AS_ADVANCED( + CMAKE_BACKWARDS_COMPATIBILITY + CMAKE_BUILD_TYPE + CMAKE_INSTALL_PREFIX + EXECUTABLE_OUTPUT_PATH + LIBRARY_OUTPUT_PATH + CMAKE_OSX_ARCHITECTURES + CMAKE_OSX_SYSROOT +) + +## For autopackage +MARK_AS_ADVANCED( + ENABLE_BINRELOC + APPDATADIR +) +OPTION(ENABLE_BINRELOC "Enable autopackage's BINRELOC features" OFF) +SET(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2") + +## Check endianess + +INCLUDE(TestBigEndian) +TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + +## Add lots of dependencies to compiler switches + +FIND_PACKAGE(SDL REQUIRED) +MARK_AS_ADVANCED( + SDLMAIN_LIBRARY + SDL_INCLUDE_DIR + SDL_LIBRARY +) +INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) + +FIND_PACKAGE(SDL_image REQUIRED) +MARK_AS_ADVANCED( + SDLIMAGE_INCLUDE_DIR + SDLIMAGE_LIBRARY +) +INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR}) + +OPTION(ENABLE_OPENGL "Enable OpenGL support" ON) +IF(ENABLE_OPENGL) + FIND_PACKAGE(OpenGL) + IF(${OPENGL_FOUND} STREQUAL "YES") + INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + SET(HAVE_OPENGL TRUE) + ENDIF(${OPENGL_FOUND} STREQUAL "YES") +ENDIF(ENABLE_OPENGL) + +FIND_PACKAGE(OpenAL REQUIRED) +MARK_AS_ADVANCED( + OPENAL_INCLUDE_DIR + OPENAL_LIBRARY +) +INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) + +FIND_PACKAGE(OggVorbis REQUIRED) +MARK_AS_ADVANCED( + OGG_LIBRARY + VORBISENC_LIBRARY + VORBISFILE_LIBRARY + VORBIS_INCLUDE_DIR + VORBIS_LIBRARY +) +INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIR}) + +FIND_PACKAGE(PhysFS REQUIRED) +MARK_AS_ADVANCED( + PHYSFS_INCLUDE_DIR + PHYSFS_LIBRARY +) +INCLUDE_DIRECTORIES(${PHYSFS_INCLUDE_DIR}) + +FIND_PACKAGE(CURL) +IF(CURL_FOUND) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR}) + SET(HAVE_LIBCURL TRUE) +ENDIF(CURL_FOUND) + +#FIND_PACKAGE(ICONV REQUIRED) +#INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) +#LINK_LIBRARIES(${ICONV_LIBRARY}) + +## Find revision of WC +FIND_PACKAGE(Subversion) +IF(Subversion_FOUND) + Subversion_WC_INFO(${SUPERTUX_SOURCE_DIR} SUPERTUX) + SET(REVISION " r${SUPERTUX_WC_REVISION}") +ENDIF(Subversion_FOUND) + +## Check platform-dependent build options + +INCLUDE(ConfigureChecks) + +## Create config.h + +configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h ) +include_directories (${CMAKE_BINARY_DIR}/) + +## Also execute instructions in src/squirrel/CMakeLists.txt + +ADD_SUBDIRECTORY(src/squirrel) + +## Add squirrel lib dir to search path + +LINK_DIRECTORIES(src/squirrel) + +## Some additional include paths + +include_directories (${SUPERTUX_SOURCE_DIR}/src/) +include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/include/) + +## Build list of sources for supertux binary + +FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/*/*.cpp src/obstack/*.c) + +## Precompile "a few" headers in GCC +OPTION(PRECOMPILE_HEADERS "Precompile headers (experimental)" OFF) +IF(PRECOMPILE_HEADERS) + FILE(GLOB PRECOMPILED_HEADERS RELATIVE ${SUPERTUX_SOURCE_DIR} src/badguy/badguy.hpp + src/scripting/wrapper.hpp src/video/*.hpp src/math/*.hpp) + FILE(WRITE ${SUPERTUX_BINARY_DIR}/precompile.hh "// Precompiled headers\n") + FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#ifndef __SUPERTUX_PRECOMPILED_HEADER\n") + FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#define __SUPERTUX_PRECOMPILED_HEADER\n") + FOREACH(PRECOMPILED_HEADER ${PRECOMPILED_HEADERS}) + FILE(RELATIVE_PATH PRECOMPILED_HEADER ${SUPERTUX_SOURCE_DIR}/src "${SUPERTUX_SOURCE_DIR}/${PRECOMPILED_HEADER}") + FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#include \"${PRECOMPILED_HEADER}\"\n") + ENDFOREACH(PRECOMPILED_HEADER) + FILE(APPEND ${SUPERTUX_BINARY_DIR}/precompile.hh "#endif /*__SUPERTUX_PRECOMPILED_HEADER*/\n") + ADD_CUSTOM_COMMAND( + OUTPUT ${SUPERTUX_BINARY_DIR}/precompile.hh.gch + COMMAND ${CMAKE_CXX_COMPILER} -x "c++-header" $(CXX_FLAGS) ${SUPERTUX_BINARY_DIR}/precompile.hh + DEPENDS ${PRECOMPILED_HEADERS} + COMMENT "Building precompiled header..." + ) + ## Make certain it is built + SET(SUPERTUX_SOURCES ${SUPERTUX_BINARY_DIR}/precompile.hh.gch ${SUPERTUX_SOURCES}) + SET(CMAKE_CXX_FLAGS "-include ${SUPERTUX_BINARY_DIR}/precompile.hh" ${CMAKE_CXX_FLAGS}) +ELSE(PRECOMPILE_HEADERS) + IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh) + FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh) + ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh) + IF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) + FILE(REMOVE ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) + ENDIF(EXISTS ${SUPERTUX_BINARY_DIR}/precompile.hh.gch) +ENDIF(PRECOMPILE_HEADERS) + + +## Debug options + +OPTION(DEBUG "Build with debugging options" OFF) +OPTION(PROFILE "Build with profiling information" OFF) +OPTION(WERROR "Stops on first compiler warning in debug mode" ON) +IF(CMAKE_COMPILER_IS_GNUCC) + ADD_DEFINITIONS(-Wall -W) + IF (DEBUG) + REMOVE_DEFINITIONS(-O2) + ADD_DEFINITIONS(-O0 -g) + IF(WERROR) + ADD_DEFINITIONS(-Werror) + ENDIF(WERROR) + ELSE (DEBUG) + ADD_DEFINITIONS(-O2) + REMOVE_DEFINITIONS(-O0 -g) + ENDIF (DEBUG) + IF (PROFILE) + ADD_DEFINITIONS(-pg) + ELSE (PROFILE) + REMOVE_DEFINITIONS(-pg) + ENDIF (PROFILE) +ENDIF(CMAKE_COMPILER_IS_GNUCC) + +## Add in squirrel debug stuff + +OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" OFF) +IF(ENABLE_SQDBG) + include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/) + FILE(GLOB SQDBG_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/squirrel/sqdbg/*.cpp) + SET(SUPERTUX_SOURCES ${SQDBG_SOURCES} ${SUPERTUX_SOURCES}) +ENDIF(ENABLE_SQDBG) + +## Build miniswig and generate miniswig wrapper + +OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG}) +IF(GENERATE_WRAPPER) + ADD_SUBDIRECTORY(tools/miniswig) + FILE(GLOB GENERATE_WRAPPER_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/scripting/*.?pp) + LIST(REMOVE_ITEM GENERATE_WRAPPER_SOURCES "src/scripting/wrapper.cpp" "src/scripting/wrapper.hpp") + ADD_CUSTOM_COMMAND( + OUTPUT ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp + COMMAND cd ${SUPERTUX_SOURCE_DIR} && ${CMAKE_CXX_COMPILER} + ARGS -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o ${SUPERTUX_BINARY_DIR}/miniswig.tmp + COMMAND tools/miniswig/miniswig + 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 + DEPENDS ${GENERATE_WRAPPER_SOURCES} tools/miniswig/miniswig + ) +ENDIF(GENERATE_WRAPPER) + +IF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) + SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) +ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) + +## If xgettext is available, generate messages.pot for sources + +OPTION(GENERATE_MESSAGESPOT "Generate messages.pot files" ${DEBUG}) +IF(GENERATE_MESSAGESPOT) + MARK_AS_ADVANCED( + XGETTEXT_EXECUTABLE + ) + FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext) + IF(NOT XGETTEXT_EXECUTABLE) + MESSAGE(STATUS "Warning: xgettext not found - will not update messages.pot") + ELSE(NOT XGETTEXT_EXECUTABLE) + MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}") + + SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/data/locale/messages.pot) + ADD_CUSTOM_COMMAND( + OUTPUT ${MESSAGES_POT_FILE} + COMMAND ${XGETTEXT_EXECUTABLE} + ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES} + DEPENDS ${SUPERTUX_SOURCES} + WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR} + COMMENT "Generating POT file ${MESSAGES_POT_FILE}" + ) + LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE}) + + FILE(GLOB SUPERTUX_LEVEL_DIRS RELATIVE ${SUPERTUX_SOURCE_DIR} data/levels/*) + LIST(REMOVE_ITEM SUPERTUX_LEVEL_DIRS "data/levels/.svn") + FOREACH(SUPERTUX_LEVEL_DIR ${SUPERTUX_LEVEL_DIRS}) + FILE(GLOB SUPERTUX_LEVELS RELATIVE ${SUPERTUX_SOURCE_DIR} ${SUPERTUX_LEVEL_DIR}/*.stl ${SUPERTUX_LEVEL_DIR}/*.stwm ${SUPERTUX_LEVEL_DIR}/*.txt) + + ## Do not add target if SUPERTUX_LEVELS is empty. This is needed for cmake <=2.4 + IF(SUPERTUX_LEVELS) + SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot) + ADD_CUSTOM_COMMAND( + OUTPUT ${MESSAGES_POT_FILE} + COMMAND ${XGETTEXT_EXECUTABLE} + ARGS --keyword="_:1" --language=Lisp --sort-by-file --output=${MESSAGES_POT_FILE} ${SUPERTUX_LEVELS} + DEPENDS ${SUPERTUX_LEVELS} + WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR} + COMMENT "Generating POT file ${MESSAGES_POT_FILE}" + ) + LIST(APPEND MESSAGES_POT_FILES ${MESSAGES_POT_FILE}) + ENDIF(SUPERTUX_LEVELS) + + ENDFOREACH(SUPERTUX_LEVEL_DIR) + + ADD_CUSTOM_TARGET( + supertux2-messages ALL + DEPENDS ${MESSAGES_POT_FILES} + ) + + ENDIF(NOT XGETTEXT_EXECUTABLE) +ENDIF(GENERATE_MESSAGESPOT) + +## Some additional compiler switches +IF(CMAKE_COMPILER_IS_GNUCC) + ADD_DEFINITIONS(-fno-strict-aliasing) +ENDIF(CMAKE_COMPILER_IS_GNUCC) + +IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + ADD_DEFINITIONS(-DMACOSX) +ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + + +## On Windows, add an icon + +IF(WIN32) + SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.rc) + IF(MINGW) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o + 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) + SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o) + ELSE(MINGW) + SET(SUPERTUX_EXE_SRCS ${SUPERTUX_EXE_SRCS} supertux.rc) + ENDIF(MINGW) +ENDIF(WIN32) + +## Add binreloc.c if enabled +IF(ENABLE_BINRELOC) + SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/binreloc/binreloc.c) +ENDIF(ENABLE_BINRELOC) + + +## Generate supertux executable in the right place + +SET(EXECUTABLE_OUTPUT_PATH ${SUPERTUX_SOURCE_DIR}) + +## Add target for supertux binary + +ADD_EXECUTABLE(supertux2 ${SUPERTUX_SOURCES}) + +## Link supertux binary with squirrel and other libraries + +TARGET_LINK_LIBRARIES(supertux2 squirrel) +TARGET_LINK_LIBRARIES(supertux2 ${SDL_LIBRARY}) +TARGET_LINK_LIBRARIES(supertux2 ${SDLIMAGE_LIBRARY}) +TARGET_LINK_LIBRARIES(supertux2 ${OPENAL_LIBRARY}) +TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES}) +TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY}) +IF(HAVE_OPENGL) + TARGET_LINK_LIBRARIES(supertux2 ${OPENGL_LIBRARY}) +ENDIF(HAVE_OPENGL) +IF(HAVE_LIBCURL) + TARGET_LINK_LIBRARIES(supertux2 ${CURL_LIBRARY}) +ENDIF(HAVE_LIBCURL) + +## Install stuff + +IF(WIN32 AND NOT UNIX) + + SET(INSTALL_SUBDIR_BIN ".") + SET(INSTALL_SUBDIR_SHARE "data/") + SET(INSTALL_SUBDIR_DOC ".") + + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/SDL_image.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/iconv.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libogg-0.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libphysfs-1-0-0.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/OpenAl32.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/wrap_oal.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/libcurl-4.dll DESTINATION ${INSTALL_SUBDIR_BIN}) + + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.ico DESTINATION ".") + +ELSE(WIN32 AND NOT UNIX) +IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + + SET(INSTALL_SUBDIR_BIN "SuperTux.app/Contents/MacOS/") + SET(INSTALL_SUBDIR_SHARE "SuperTux.app/Contents/Resources/data/") + SET(INSTALL_SUBDIR_DOC "SuperTux.app/Contents/Resources/") + + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/tools/darwin/info.plist DESTINATION "SuperTux.app/Contents/") + + 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/") + +ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + + SET(INSTALL_SUBDIR_BIN "games/") + SET(INSTALL_SUBDIR_SHARE "share/games/supertux2/") + SET(INSTALL_SUBDIR_DOC "share/doc/supertux2/") + + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/supertux2.desktop DESTINATION "share/applications") + + INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.png ${SUPERTUX_SOURCE_DIR}/data/images/engine/icons/supertux.xpm DESTINATION "share/pixmaps/") + +ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +ENDIF(WIN32 AND NOT UNIX) + +INSTALL(TARGETS supertux2 DESTINATION ${INSTALL_SUBDIR_BIN}) + +INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/INSTALL ${SUPERTUX_SOURCE_DIR}/README ${SUPERTUX_SOURCE_DIR}/COPYING ${SUPERTUX_SOURCE_DIR}/WHATSNEW.txt DESTINATION ${INSTALL_SUBDIR_DOC}) + +INSTALL(FILES ${SUPERTUX_SOURCE_DIR}/data/credits.txt DESTINATION ${INSTALL_SUBDIR_SHARE}) +INSTALL(DIRECTORY data/images DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/levels DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/music DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/scripts DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/speech DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/sounds DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) +INSTALL(DIRECTORY data/locale DESTINATION ${INSTALL_SUBDIR_SHARE} PATTERN ".svn" EXCLUDE) + + +## CPack/Installation-specific stuff + +INCLUDE(InstallRequiredSystemLibraries) +SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux") +SET(CPACK_PACKAGE_VENDOR "SuperTux Devel Team") +SET(CPACK_PACKAGE_CONTACT "SuperTux Devel Team ") +SET(CPACK_DEBIAN_PACKAGE_NAME "supertux2") +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)") +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/") +SET(CPACK_DEBIAN_PACKAGE_SECTION "games") +SET(CPACK_RPM_PACKAGE_NAME "supertux2") +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/") +SET(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)") +SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade") +IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # The OS X PackageMaker doesn't seem to like files with no extension +ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + SET(CPACK_PACKAGE_DESCRIPTION_FILE "${SUPERTUX_SOURCE_DIR}/README") + SET(CPACK_RESOURCE_FILE_LICENSE "${SUPERTUX_SOURCE_DIR}/COPYING") +ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +SET(CPACK_PACKAGE_VERSION_MAJOR "0") +SET(CPACK_PACKAGE_VERSION_MINOR "3") +SET(CPACK_PACKAGE_VERSION_PATCH "2-SVN") +SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +SET(CPACK_PACKAGE_EXECUTABLES "..\\\\supertux2" "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +IF(WIN32 AND NOT UNIX) + SET(CPACK_NSIS_INSTALLED_ICON_NAME "..\\\\supertux2") + SET(CPACK_NSIS_DISPLAY_NAME "SuperTux ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +ELSE(WIN32 AND NOT UNIX) +ENDIF(WIN32 AND NOT UNIX) +INCLUDE(CPack) +