2010-07-03 15:54:26 +02:00
##########################################################################################
# Settings that are common to all target systems.
2010-09-16 23:46:02 +02:00
SET ( INTERNAL_NAME "speed-dreams" )
2010-07-03 15:54:26 +02:00
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-09-28 21:51:45 +02:00
SET ( CPACK_RESOURCE_FILE_LICENSE "${SOURCE_DIR}/COPYING.txt" )
SET ( CPACK_RESOURCE_FILE_README "${SOURCE_DIR}/README.txt" )
2010-02-28 10:04:35 +01:00
2010-09-16 23:46:02 +02:00
SET ( EXECUTABLE_NAME "${INTERNAL_NAME}" )
2010-07-10 21:21:13 +02:00
SET ( CPACK_PACKAGE_EXECUTABLES "${EXECUTABLE_NAME};Start ${CPACK_PACKAGE_NAME}" )
2010-07-03 15:54:26 +02:00
# 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.
2010-09-16 23:46:02 +02:00
SET ( PACKAGE_FILE_PREFIX "${INTERNAL_NAME}" )
2010-07-03 15:54:26 +02:00
#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
2010-11-16 23:15:27 +01:00
" / 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 / " " / _ C P a c k _ P a c k a g e s / "
" / 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 $ "
" / \ \ \ \ . s v n / " " / \ \ \ \ . d i r / " " / C M a k e F i l e s / "
2010-07-03 15:54:26 +02:00
" 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 $ "
2010-11-16 23:15:27 +01:00
" \ \ \ \ . b a k $ " " \ \ \ \ . f l c $ " " #.*#$" "~$" "\\\\.~.*"
2011-03-05 16:50:27 +01:00
" \ \ \ \ . x c f $ " " \ \ \ \ . x c f \ \ \ \ . b z 2 $ " " \ \ \ \ . p s d $ "
" \ \ \ \ . e x e $ " " / s d 2 - . * $ " " / s p e e d - d r e a m s - 2 $ " " / x m l v e r s i o n $ "
" \ \ \ \ . z i p $ " " \ \ \ \ . t a r \ \ \ \ . b z 2 $ " " \ \ \ \ . t a r \ \ \ \ . g z $ " " \ \ \ \ . t a r \ \ \ \ . Z $ " " \ \ \ \ . t a r \ \ \ \ . 7 z $ " )
2010-07-03 15:54:26 +02:00
##########################################################################################
# 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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_BINARY )
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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_SOURCE )
2010-07-03 15:54:26 +02:00
# 9.10 ubuntu depends
2010-07-10 17:29:28 +02:00
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "freeglut3,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)" )
2010-07-03 15:54:26 +02:00
# Put other Debian-based distros settings here.
# Source package specific settings.
2010-11-16 23:15:27 +01:00
LIST ( APPEND CPACK_SOURCE_IGNORE_FILES "Makefile$" "\\\\.so$" )
2010-07-03 15:54:26 +02:00
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
2010-07-10 21:21:13 +02:00
# General note: 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.
2010-11-16 23:15:27 +01:00
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "${INTERNAL_NAME}-${VERSION_LONG}" )
2010-09-16 23:46:02 +02:00
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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_BINARY )
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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_SOURCE )
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}" )
2010-11-16 23:15:27 +01:00
# Icon for the generated installer/uninstaller files.
2010-07-03 15:54:26 +02:00
SET ( CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}\\\\data\\\\data\\\\icons\\\\icon.ico" )
2010-07-10 21:21:13 +02:00
#SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}\\\\data\\\\data\\\\icons\\\\icon.ico")
SET ( CPACK_PACKAGE_ICON ${ CMAKE_SOURCE_DIR } \\\\installer\\\\windows\\\\header.bmp)
2010-07-03 15:54:26 +02:00
2010-11-16 23:15:27 +01:00
# Extra shortcuts to add in the start menu (a list of pairs : URL, Menu label).
2010-07-10 21:21:13 +02:00
SET ( CPACK_NSIS_MENU_LINKS
2010-11-16 23:15:27 +01:00
" $ { C P A C K _ P A C K A G E _ C O N T A C T } " " P r o j e c t H o m e p a g e " )
#"$INSTDIR\\\\share\\\\doc\\\\userman\\\\how_to_drive.html" "User manual")
2010-07-03 15:54:26 +02:00
# 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 / "
2010-11-16 23:15:27 +01:00
" \ \ \ \ . s l n $ " " \ \ \ \ . s u o $ " " \ \ \ \ . n c b $ " " \ \ \ \ . v c p r o j * $ " " \ \ \ \ . d l l $ " )
2010-07-03 15:54:26 +02:00
2010-07-06 00:13:54 +02:00
# Add the PACKAGE_SRC project in the MSVC solution
2010-09-16 23:46:02 +02:00
# (CMake 2.6 and 2.8 fail to do this itself).
2010-07-06 00:13:54 +02:00
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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_BINARY )
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)" )
2011-05-03 15:15:11 +02:00
MARK_AS_ADVANCED ( PACKAGERS_SOURCE )
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 )