2010-02-28 10:04:35 +01:00
INCLUDE ( InstallRequiredSystemLibraries )
2010-07-03 15:54:26 +02:00
##########################################################################################
# Settings that are common to all target systems.
SET ( CPACK_PACKAGE_NAME "Speed Dreams" )
SET ( CPACK_PACKAGE_VENDOR "the Speed Dreams team" )
SET ( CPACK_PACKAGE_CONTACT "http:\\\\\\\\www.speed-dreams.org" )
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Speed Dreams (an Open Motorsport Sim) is a racing simulation that allows you to drive in races against opponents simulated by the computer ; it is GPL 2+ and has been forked from TORCS in late 2008" )
2010-02-28 10:04:35 +01:00
SET ( CPACK_RESOURCE_FILE_LICENSE "${SOURCE_DIR}/COPYING" )
SET ( CPACK_RESOURCE_FILE_README "${SOURCE_DIR}/README" )
2010-07-03 15:54:26 +02:00
SET ( EXECUTABLE_NAME "speed-dreams" )
SET ( CPACK_PACKAGE_EXECUTABLES "${EXECUTABLE_NAME};Speed Dreams" )
# Version settings.
# * the short way.
SET ( CPACK_PACKAGE_VERSION "${VERSION_LONG}" )
# * another way.
#SET(CPACK_PACKAGE_VERSION_MAJOR "2")
#SET(CPACK_PACKAGE_VERSION_MINOR "0")
#SET(CPACK_PACKAGE_VERSION_PATCH "0")
#SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-alpha")
#IF(NOT SVN_FIND_REV_FAILED)
# SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}-r${SVN_REV}")
#ENDIF(NOT SVN_FIND_REV_FAILED)
# Binary package settings.
SET ( PACKAGE_FILE_PREFIX "speed-dreams" )
#SET(CPACK_OUTPUT_CONFIG_FILE "/home/andy/vtk/CMake-bin/CPackConfig.cmake")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "/home/andy/vtk/CMake/Copyright.txt")
#SET(CPACK_IGNORE_FILES "/\\.svn/;\\.swp$;\\.#;/#;${CPACK_IGNORE_FILES}")
# Source package settings.
#SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/home/andy/vtk/CMake-bin/CPackSourceConfig.cmake")
SET ( CPACK_SOURCE_PACKAGE_FILE_NAME "${PACKAGE_FILE_PREFIX}-${CPACK_PACKAGE_VERSION}-src" )
#SET(CPACK_RESOURCE_FILE_LICENSE "/home/andy/vtk/CMake/Copyright.txt")
#SET(CPACK_RESOURCE_FILE_README "/home/andy/vtk/CMake/Templates/CPack.GenericDescription.txt")
#SET(CPACK_RESOURCE_FILE_WELCOME "/home/andy/vtk/CMake/Templates/CPack.GenericWelcome.txt")
SET ( CPACK_SOURCE_IGNORE_FILES
" i n s t a l l e r / " " d o c / d e s i g n / " " d o c / d e v e l d o c " " d o c / w e b s i t e / "
" / \ \ \ \ . s v n / " " \ \ \ \ . b a k $ " " #.*#$" "~$" "\\\\.~.*" "\\\\.xcf$" "\\\\.xcf\\\\.bz2$"
" _ C P a c k _ P a c k a g e s / " " / \ \ \ \ . d i r / " " / C M a k e F i l e s / "
" c m a k e _ i n s t a l l \ \ \ \ . c m a k e $ " " C P a c k C o n f i g \ \ \ \ . c m a k e $ " " C P a c k S o u r c e C o n f i g \ \ \ \ . c m a k e $ "
" C M a k e C a c h e \ \ \ \ . t x t $ " " i n s t a l l _ m a n i f e s t \ \ \ \ . t x t $ " " x m l v e r s i o n _ l o c \ \ \ \ . t x t $ "
" c o n f i g \ \ \ \ . h $ " " v e r s i o n \ \ \ \ . h $ " " d o x y g e n _ c o n f i g $ "
" \ \ \ \ . e x e $ " " \ \ \ \ . z i p $ " " \ \ \ \ . t a r \ \ \ \ . b z 2 $ " " \ \ \ \ . t a r \ \ \ \ . g z $ " " \ \ \ \ . t a r \ \ \ \ . Z $ " )
##########################################################################################
# Put Linux install information here
2010-02-28 10:04:35 +01:00
IF ( UNIX )
2010-07-03 15:54:26 +02:00
SET ( PACKAGERS_BINARY "DEB" CACHE STRING "CPack binary package generators to use (separated with ';', among DEB, RPM, STGZ, TGZ, TBZ2, TZ, ZIP)" )
2010-07-06 00:13:54 +02:00
SET ( PACKAGERS_SOURCE "TBZ2" CACHE STRING "CPack source package generators to use (separated with ';', among TGZ, TBZ2, TZ, ZIP)" )
2010-07-03 15:54:26 +02:00
# 9.10 ubuntu depends
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "freeglut3, libalut0(>=1.1.0-1),libc6(>=2.7),libgcc1(>=1:4.1.1),libgl1-mesa-glx | libgl1,libglu1-mesa | libglu1,libice6(>=1:1.0.0),libopenal1(>=1:1.3.253),libpng12-0(>=1.2.13-4),libsm6,libstdc++6(>=4.2.1),libx11-6,libxext6,libxi6(>=2:1.1.3-1ubuntu1),libxmu6,libxrandr2,libxrender1,libxt6,libxxf86vm1,plib1.8.4c2(>=1.2.4),zlib1g(>=1:1.1.4)" )
# Put other Debian-based distros settings here.
# Source package specific settings.
LIST ( APPEND CPACK_SOURCE_IGNORE_FILES "Makefile$" )
2010-02-28 10:04:35 +01:00
ENDIF ( UNIX )
2010-07-03 15:54:26 +02:00
##########################################################################################
# Put Windows install information here.
# (NSIS must be installed on your computer for this to work)
2010-02-28 10:04:35 +01:00
IF ( WIN32 )
2010-07-03 15:54:26 +02:00
SET ( EXECUTABLE_PATHNAME "$INSTDIR\\\\bin\\\\${EXECUTABLE_NAME}.exe" )
SET ( PACKAGERS_BINARY "NSIS" CACHE STRING "CPack binary package generators to use (separated with ';', among NSIS, CygwinBinary, STGZ, TGZ, TBZ2, TZ, ZIP)" )
2010-07-06 00:13:54 +02:00
SET ( PACKAGERS_SOURCE "ZIP" CACHE STRING "CPack source package generators to use (separated with ';', among TGZ, TBZ2, TZ, ZIP)" )
2010-07-03 15:54:26 +02:00
SET ( CPACK_PACKAGE_FILE_NAME "${PACKAGE_FILE_PREFIX}-${CPACK_PACKAGE_VERSION}-win32-setup" )
SET ( CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}" )
SET ( CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_DISPLAY_NAME}" )
# 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_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}\\\\data\\\\data\\\\icons\\\\icon.ico" )
#SET(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}\\\\data\\\\data\\\\icons\\\\icon.ico)
SET ( CPACK_NSIS_MENU_LINKS "${CPACK_PACKAGE_CONTACT}" "Homepage for ${CPACK_PACKAGE_NAME}" )
# Icon in the add/remove control panel. Must be an .exe file
Set ( CPACK_NSIS_INSTALLED_ICON_NAME "${EXECUTABLE_PATHNAME}" )
SET ( CPACK_NSIS_URL_INFO_ABOUT "${CPACK_PACKAGE_CONTACT}" )
SET ( CPACK_NSIS_HELP_LINK "${CPACK_PACKAGE_CONTACT}" )
# Add a page in the install wizard for options :
# - adding the installation path in the PATH,
# - adding a shortcut to start the installed app on the desktop.
#SET(CPACK_NSIS_MODIFY_PATH "ON")
# Another way to add a shortcut to start the installed app on the desktop :
# This doesn't work.
#SET(CPACK_CREATE_DESKTOP_LINKS "${EXECUTABLE_NAME}")
# But this works.
SET ( SHORTCUT_TARGET "$DESKTOP\\\\${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}.lnk" )
SET ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS
" C r e a t e S h o r t C u t \ \ \ " $ { S H O R T C U T _ T A R G E T } \ \ \ " \ \ \ " $ { E X E C U T A B L E _ P A T H N A M E } \ \ \ " " )
SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\" ${ SHORTCUT_TARGET } \\\"")
# Source package specific settings.
LIST ( APPEND CPACK_SOURCE_IGNORE_FILES
2010-07-06 00:13:54 +02:00
" / V T u n e / "
2010-07-03 15:54:26 +02:00
" / R e l e a s e / " " / D e b u g / " " / R e l W i t h D e b I n f o / " " / M i n S i z e R e l / "
" / r e l e a s e / " " / d e b u g / " " / r e l w i t h d e b i n f o / " " / m i n s i z e r e l / "
" \ \ \ \ . s l n $ " " \ \ \ \ . s u o $ " " \ \ \ \ . n c b $ " " \ \ \ \ . v c p r o j * " )
2010-07-06 00:13:54 +02:00
# Add the PACKAGE_SRC project in the MSVC solution
# (CMake 2.6 or 2.8 fails to do this itself).
ADD_CUSTOM_TARGET ( PACKAGE_SRC )
ADD_CUSTOM_COMMAND ( TARGET PACKAGE_SRC
C O M M A N D $ { C M A K E _ C P A C K _ C O M M A N D } - C $ ( O u t D i r ) - - c o n f i g . / C P a c k S o u r c e C o n f i g . c m a k e )
2010-07-03 15:54:26 +02:00
2010-02-28 10:04:35 +01:00
ENDIF ( WIN32 )
2010-07-03 15:54:26 +02:00
##########################################################################################
# Put Mac OS X install information here
IF ( APPLE )
SET ( PACKAGERS_BINARY "DragNDrop" CACHE STRING "CPack binary package generators to use (separated with ';', among Bundle, DragNDrop, PackageMaker, OSXX11, STGZ, TGZ, TBZ2, TZ, ZIP)" )
2010-07-06 00:13:54 +02:00
SET ( PACKAGERS_SOURCE "TBZ2" CACHE STRING "CPack source package generators to use (separated with ';', among TGZ, TBZ2, TZ, ZIP)" )
2010-07-03 15:54:26 +02:00
# Source package specific settings.
LIST ( APPEND CPACK_SOURCE_IGNORE_FILES "Makefile$" )
ENDIF ( APPLE )
##########################################################################################
# Final settings.
SET ( CPACK_GENERATOR ${ PACKAGERS_BINARY } )
SET ( CPACK_SOURCE_GENERATOR ${ PACKAGERS_SOURCE } )
2010-02-28 10:04:35 +01:00
INCLUDE ( CPack )