package.cmake 5.08 KB
Newer Older
1 2
OPTION(CREATE_DEBS "Will create DEBs" No)
OPTION(CREATE_RPMS "Will create RPMs" No)
3

Ildar Mulyukov's avatar
Ildar Mulyukov committed
4
SET(CGENIUS_DESKTOP_DIR "share/applications/")
Gerstrong's avatar
Gerstrong committed
5

Gerhard Stein's avatar
Gerhard Stein committed
6

7 8 9 10 11 12 13 14
# Now let's setup the package for installation. You can create the package of the chosen build
# running make package, and if needed just runs that package
# For Linux it will create Debian Packages and replace the manual script I have been using in the past.

## Generation of Packages.
# Generation of Packages. Common stuff and Basic variables
SET(CPACK_PACKAGE_NAME "CGenius")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The ultimate Commander Keen interpreter")
Gerstrong's avatar
Gerstrong committed
15
SET(CPACK_PACKAGE_DESCRIPTION "Commander-Genius aka CloneKeenPlus is an engine which interprets Commander Keen 1-6 (Vorticons and Galaxy Series).\n .\n As fans and developers we try to implement new features, improve the gameplay and give the feeling, you are playing the original game.\n .\n Obviously you need the game data of the games to play it.\n Commander Keen 1 and 4 come included in this package.\n Episode 2, 3, 5 and 6 are registered versions which can be purchased by 3D Realms or Apogee, or bought by someone else.\n If you still have the old games of the registered version, then give it a try. You will be surprised, how well they will look!\n")
Gerstrong's avatar
Gerstrong committed
16
SET(CPACK_PACKAGE_VENDOR "The Commmander-Genius Team")
17
SET(CPACK_PACKAGE_VERSION ${CG_VERSION})
18
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_BINARY_DIR}/README")
19
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_BUILD_TYPE}")
20 21
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYRIGHT")

22

Gerhard Stein's avatar
Gerhard Stein committed
23
IF(WIN32)
Gerhard Stein's avatar
Gerhard Stein committed
24
	SET(APPDIR CGenius)
25 26
	SET(CPACK_PACKAGE_INSTALL_DIRECTORY ${APPDIR})
	SET(CPACK_GENERATOR "ZIP;NSIS")
Gerhard Stein's avatar
Gerhard Stein committed
27
ELSE(WIN32)
28 29
	SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr/games")
	SET(CPACK_GENERATOR "TGZ")
Gerstrong's avatar
Gerstrong committed
30
	INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/share/cgenius.desktop DESTINATION ${CGENIUS_DESKTOP_DIR})
31
ENDIF(WIN32)
32

33 34 35
FILE(GLOB CACHE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/vfsroot/cache/*.png")
INSTALL(FILES ${CACHE_FILES} DESTINATION ${DOCDIR}/cache)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/vfsroot/gameCatalogue.xml DESTINATION ${DOCDIR})
36 37


38

Gerhard Stein's avatar
Gerhard Stein committed
39
IF(WIN32)
40
  # There is a bug in NSI that does not handle full unix paths properly. Make
41
  # sure there is at least one set of four (4) backslashes.    
42
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "CGenius.exe")
Gerstrong's avatar
Gerstrong committed
43
  SET(CPACK_NSIS_DISPLAY_NAME "Commander-Genius")
44 45 46
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\clonekeenplus.sourceforge.net")
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\clonekeenplus.sourceforge.net")
  SET(CPACK_NSIS_CONTACT "gerstrong@gmail.com")
47
  SET(CPACK_NSIS_MODIFY_PATH OFF)
48
  SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_BUILD_TYPE}-win32")
49
  set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Commander Genius.lnk' '\$INSTDIR\\\\CGenius\\\\CGenius.exe'")
Gerhard Stein's avatar
Gerhard Stein committed
50 51
ENDIF()

52 53 54 55
SET(CPACK_PACKAGE_EXECUTABLES "CGenius" "Commander Genius")

# This section is only called if the user wants to get debian packages created
IF(CREATE_DEBS)
Gerhard Stein's avatar
Gerhard Stein committed
56
	IF(WIN32)
57
		MESSAGE("NOTE: Windows does not use DEB Packages. Those won't be build here...")
Gerhard Stein's avatar
Gerhard Stein committed
58
	ELSE(WIN32)
59 60 61 62 63
		SET(CPACK_GENERATOR "DEB;${CPACK_GENERATOR}") # For Debian, Ubuntu etc...
		SET(CPACK_DEBIAN_PACKAGE_NAME "CGenius")
		SET(CPACK_DEBIAN_PACKAGE_MAINTAINER  "Gerhard Stein <gerstrong@gmail.com>")
		SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n .\n ${CPACK_PACKAGE_DESCRIPTION}")

64 65 66 67 68
		IF(BUILD_ARCH STREQUAL amd64)
			SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64)
		ELSEIF(BUILD_ARCH STREQUAL i386)
			SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
		ENDIF(BUILD_ARCH STREQUAL amd64)
69
                SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libvorbis0a (>= 1.2.3), libvorbisenc2 (>> 1.2.3), libvorbisfile3 (>= 1.2.3), libsdl2-2.0-0 (>= 2.0.0), libgl1-mesa-glx (>= 7.7.1), libsdl2-image-2.0-0 (>= 2.0), libsdl2-mixer-2.0-0 (>= 2.0), libpython3.5 (>= 3.5.2)")
70 71
		SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
		SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
Gerhard Stein's avatar
Gerhard Stein committed
72
	ENDIF(WIN32)
73 74
ENDIF(CREATE_DEBS)

75 76 77

# This section is only called if the user wants to get debian packages created
IF(CREATE_RPMS)
Gerhard Stein's avatar
Gerhard Stein committed
78
	IF(WIN32)
79
		MESSAGE("NOTE: Windows does not use RPM Packages. Those won't be build here...")
Gerhard Stein's avatar
Gerhard Stein committed
80
	ELSE(WIN32)
81 82 83 84 85
		SET(CPACK_GENERATOR "RPM;${CPACK_GENERATOR}") # For Fedora, OpenSuse, etc.
		SET(CPACK_RPM_PACKAGE_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
		SET(CPACK_RPM_PACKAGE_NAME "CGenius")
		SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})

Gerhard Stein's avatar
Gerhard Stein committed
86
		IF(BUILD_TARGET STREQUAL LINUX64)
87
			SET(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
Gerhard Stein's avatar
Gerhard Stein committed
88
		ENDIF(BUILD_TARGET STREQUAL LINUX64)
89 90 91 92 93 94
		
		SET(CPACK_RPM_PACKAGE_RELEASE 1)
		SET(CPACK_RPM_PACKAGE_LICENSE "GPL 2")
		SET(CPACK_RPM_PACKAGE_GROUP "Amusements/Games")
		SET(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
		SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n .\n ${CPACK_PACKAGE_DESCRIPTION}")
Gerstrong's avatar
Gerstrong committed
95
		SET(CPACK_RPM_PACKAGE_REQUIRES "SDL >= 2.0, libvorbis >= 1.3, mesa-libGL >= 7.7")
Gerhard Stein's avatar
Gerhard Stein committed
96
	ENDIF(WIN32)
97 98
ENDIF(CREATE_RPMS)

99 100
INCLUDE(CPack)

101
MESSAGE( STATUS "CPACK_PACKAGE_VERSION = ${CPACK_PACKAGE_VERSION}" )
102