2011-04-29 15:37:41 +02:00
|
|
|
PROJECT ( fysxasteroids C CXX )
|
2010-04-14 22:01:45 +02:00
|
|
|
|
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
|
|
|
|
2011-05-04 18:33:44 +02:00
|
|
|
FIND_PACKAGE (SDL REQUIRED)
|
|
|
|
FIND_PACKAGE (SDL_net REQUIRED)
|
|
|
|
|
2010-04-05 23:38:59 +02:00
|
|
|
INCLUDE_DIRECTORIES (
|
|
|
|
engine/
|
2010-06-06 01:22:01 +02:00
|
|
|
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}
|
|
|
|
)
|
|
|
|
|
|
|
|
ADD_SUBDIRECTORY ( engine )
|
|
|
|
|
|
|
|
SET ( ASTEROIDS_SOURCES
|
|
|
|
asteroids/AsteroidEntity.cc
|
|
|
|
asteroids/Controller.cc
|
|
|
|
asteroids/ControllerCommands.cc
|
|
|
|
asteroids/EntityFactory.cc
|
|
|
|
asteroids/EnumToString.cc
|
2010-06-06 01:22:01 +02:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2011-05-04 18:33:44 +02:00
|
|
|
INCLUDE_DIRECTORIES (
|
|
|
|
${SDLMIXER_INCLUDE_DIRS}
|
|
|
|
${SDLNET_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2010-12-03 00:16:59 +01:00
|
|
|
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
|
|
|
|
2010-12-03 00:16:59 +01:00
|
|
|
TARGET_LINK_LIBRARIES ( fysxasteroids
|
2010-04-05 23:38:59 +02:00
|
|
|
Engine
|
2010-11-28 23:08:52 +01:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2010-12-03 00:30:55 +01:00
|
|
|
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
|
|
|
|
)
|
2011-04-19 14:37:32 +02:00
|
|
|
|
|
|
|
INSTALL (FILES fysxasteroids.desktop fysxasteroidseditor.desktop
|
|
|
|
DESTINATION /usr/share/applications
|
|
|
|
)
|
2011-04-29 15:37:41 +02:00
|
|
|
|
|
|
|
# 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")
|
2011-05-07 01:40:17 +02:00
|
|
|
# SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
2011-04-29 15:37:41 +02:00
|
|
|
SET(CPACK_PACKAGE_CONTACT "Martin Felis <martin@fysx.org>")
|
|
|
|
|
2011-05-06 17:37:49 +02:00
|
|
|
# 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}\")
|
|
|
|
|
2011-04-29 15:37:41 +02:00
|
|
|
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.
|
2011-05-07 01:40:17 +02:00
|
|
|
SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/textures\\\\icon.bmp")
|
2011-04-29 15:37:41 +02:00
|
|
|
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\fysxasteroids.exe")
|
2011-05-07 01:40:17 +02:00
|
|
|
SET(CPACK_NSIS_DISPLAY_NAME "fysxasteroids")
|
2011-04-29 15:37:41 +02:00
|
|
|
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)
|
2011-05-07 01:40:17 +02:00
|
|
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/fysxdotorg")
|
2011-04-29 15:37:41 +02:00
|
|
|
ELSE(WIN32 AND NOT UNIX)
|
2011-05-07 01:40:17 +02:00
|
|
|
# Debian stuff
|
|
|
|
SET(CPACK_GENERATOR "DEB")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Martin Felis <martin@fysx.org>")
|
2011-04-29 15:37:41 +02:00
|
|
|
SET(CPACK_STRIP_FILES "bin/fysxasteroids" "bin/fysxasteroidseditor")
|
|
|
|
SET(CPACK_SOURCE_STRIP_FILES "TRUE")
|
|
|
|
SET(CPACK_DEBIAN_PACKAGE_SECTION "Games and Amusement")
|
|
|
|
|
2011-05-07 01:40:17 +02:00
|
|
|
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)"
|
|
|
|
)
|
2011-04-29 15:37:41 +02:00
|
|
|
|
|
|
|
ENDIF(WIN32 AND NOT UNIX)
|
|
|
|
SET(CPACK_PACKAGE_EXECUTABLES "fysxasteroids" "fysxasteroidseditor")
|
|
|
|
INCLUDE ( CPack )
|