fysxasteroids/CMakeLists.txt

156 lines
4.4 KiB
CMake
Raw Normal View History

PROJECT ( fysxasteroids C CXX )
2010-04-05 23:38:59 +02:00
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
2010-12-02 19:56:55 +01:00
# Perform the proper linking
SET (CMAKE_SKIP_BUILD_RPATH FALSE)
SET (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
2010-04-05 23:38:59 +02:00
FIND_PACKAGE (SDL REQUIRED)
FIND_PACKAGE (SDL_net REQUIRED)
2011-06-13 17:05:07 +02:00
FIND_PACKAGE (GLEW REQUIRED)
2010-04-05 23:38:59 +02:00
INCLUDE_DIRECTORIES (
engine/
asteroids/
2010-04-05 23:38:59 +02:00
include/
engine/libraries/mathlib/
engine/libraries/coll2d/include
2010-12-02 19:56:55 +01:00
engine/libraries/oglft/liboglft
2010-04-05 23:38:59 +02:00
${FREETYPE2_INCLUDE_DIR}
2011-06-13 17:05:07 +02:00
${GLEW_INCLUDE_DIR}
2010-04-05 23:38:59 +02:00
)
ADD_SUBDIRECTORY ( engine )
SET ( ASTEROIDS_SOURCES
asteroids/AsteroidEntity.cc
asteroids/Controller.cc
asteroids/ControllerCommands.cc
asteroids/EntityFactory.cc
asteroids/EnumToString.cc
asteroids/Game.cc
2010-04-05 23:38:59 +02:00
asteroids/main.cc
asteroids/Model.cc
asteroids/ModelCommands.cc
asteroids/Physics.cc
asteroids/RocketEntity.cc
asteroids/ShipEntity.cc
asteroids/View.cc
)
2011-02-13 17:14:06 +01:00
SET ( ASTEROIDSEDITOR_SOURCES
asteroids/AsteroidEntity.cc
asteroids/Controller.cc
asteroids/ControllerCommands.cc
asteroids/EntityFactory.cc
asteroids/EnumToString.cc
asteroids/Game.cc
asteroids/editormain.cc
asteroids/Model.cc
asteroids/ModelCommands.cc
asteroids/Physics.cc
asteroids/RocketEntity.cc
asteroids/ShipEntity.cc
asteroids/View.cc
)
INCLUDE_DIRECTORIES (
${SDLMIXER_INCLUDE_DIRS}
${SDLNET_INCLUDE_DIRS}
)
ADD_EXECUTABLE ( fysxasteroids ${ASTEROIDS_SOURCES} )
2011-02-13 17:14:06 +01:00
ADD_EXECUTABLE ( fysxasteroidseditor ${ASTEROIDSEDITOR_SOURCES} )
2010-04-05 23:38:59 +02:00
TARGET_LINK_LIBRARIES ( fysxasteroids
2010-04-05 23:38:59 +02:00
Engine
oglft
2010-04-05 23:38:59 +02:00
)
2010-12-02 19:56:55 +01:00
2011-02-13 17:14:06 +01:00
TARGET_LINK_LIBRARIES ( fysxasteroidseditor
Engine
oglft
)
2010-12-02 19:56:55 +01:00
SET ( DATA_DIR
data/
)
2011-02-13 17:14:06 +01:00
SET ( DATA_FILES
asteroids.rc
config.rc
)
INSTALL (TARGETS fysxasteroids
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
2011-02-13 17:14:06 +01:00
INSTALL (TARGETS fysxasteroidseditor
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
2010-12-02 19:56:55 +01:00
INSTALL (DIRECTORY ${DATA_DIR}
2010-12-03 01:02:08 +01:00
DESTINATION share/fysxasteroids/data
2010-12-02 19:56:55 +01:00
)
2011-02-13 17:14:06 +01:00
INSTALL (FILES ${DATA_FILES}
DESTINATION share/fysxasteroids
)
INSTALL (FILES fysxasteroids.desktop fysxasteroidseditor.desktop
DESTINATION /usr/share/applications
)
# CPack specific stuff
# INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_NAME "fysxasteroids")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A fun and good looking clone of the popular 80's game")
SET(CPACK_PACKAGE_VENDOR "Martin Felis <martin@fysx.org>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
2011-05-08 17:47:17 +02:00
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
# SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_PACKAGE_CONTACT "Martin Felis <martin@fysx.org>")
# Add defines for the version
SET (VERSION_STRING
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
ADD_DEFINITIONS(-DFYSXASTEROIDS_VERSION=\"${VERSION_STRING}\")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/textures\\\\icon.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\fysxasteroids.exe")
SET(CPACK_NSIS_DISPLAY_NAME "fysxasteroids")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.fysx.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.fysx.org")
SET(CPACK_NSIS_CONTACT "martin@fysx.org")
SET(CPACK_NSIS_MODIFY_PATH ON)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/fysxdotorg")
ELSE(WIN32 AND NOT UNIX)
# Debian stuff
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martin Felis <martin@fysx.org>")
SET(CPACK_STRIP_FILES "bin/fysxasteroids" "bin/fysxasteroidseditor")
SET(CPACK_SOURCE_STRIP_FILES "TRUE")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Games and Amusement")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS
"libboost-filesystem1.40.0 (>= 1.40.0-1), libboost-system1.40.0 (>= 1.40.0-1), libc6 (>= 2.4), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libglu1-mesa | libglu1, libice6 (>= 1:1.0.0), libpng12-0 (>= 1.2.13-4), libsdl-net1.2 (>= 1.2.7), libsdl-mixer1.2 (>= 1.2.6), libsdl1.2debian (>= 1.2.10-1), libsm6, libstdc++6 (>= 4.4.0), libx11-6, libxext6, zlib1g (>= 1:1.1.4)"
)
ENDIF(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "fysxasteroids" "fysxasteroidseditor")
INCLUDE ( CPack )