@@ -11,9 +11,24 @@ set(CPACK_SOURCE_IGNORE_FILES "/.gitattributes")
1111set (CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR} /README.md )
1212set (CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR} /License.txt)
1313
14- if (WIN32 )
14+ # DEB
15+ set (CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" )
16+ set (CPACK_DEBIAN_PACKAGE_SECTION "games" )
17+ set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
18+ set (CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE )
19+
20+ # RPM
21+ set (CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
22+ set (CPACK_RPM_PACKAGE_GROUP "Amusements/Games" )
23+ # -- set(CPACK_RPM_PACKAGE_AUTOREQPROV ON)
24+ set (CPACK_RPM_PACKAGE_AUTOREQ ON )
25+ set (CPACK_RPM_PACKAGE_AUTOPROV YES )
26+ set (CPACK_RPM_PACKAGE_RELEASE_DIST ON )
27+
28+ if (CPACK_GENERATOR)
29+ # do nothing, it's ok
30+ elseif (WIN32 )
1531 set (CPACK_GENERATOR 7Z)
16- include (CPack)
1732elseif (UNIX )
1833 # Try to find specific OS files to determine type of linux distribution
1934 find_file (FEDORA_FOUND fedora-release PATHS /etc)
@@ -41,25 +56,27 @@ elseif (UNIX)
4156 # --- SELECT PROPER CPACK GENERATOR ---
4257 if (DEBIAN_FOUND)
4358 set (CPACK_GENERATOR DEB)
44-
45- set (CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" )
46-
47- set (CPACK_DEBIAN_PACKAGE_SECTION "games" )
48- set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
49- set (CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE )
59+ elseif (FEDORA_FOUND OR REDHAT_FOUND OR CENTOS_FOUND)
60+ set (CPACK_GENERATOR RPM)
5061 endif ()
5162
52- if (FEDORA_FOUND OR REDHAT_FOUND OR CENTOS_FOUND)
53- set (CPACK_GENERATOR RPM)
63+ unset (FEDORA_FOUND)
64+ unset (REDHAT_FOUND)
65+ unset (CENTOS_FOUND)
66+ unset (DEBIAN_FOUND)
67+ endif ()
5468
55- set (CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
69+ if (CPACK_GENERATOR)
70+ include (CPack)
5671
57- set (CPACK_RPM_PACKAGE_GROUP "Amusements/Games" )
58- # -- set(CPACK_RPM_PACKAGE_AUTOREQPROV ON)
59- set (CPACK_RPM_PACKAGE_AUTOREQ ON )
60- set (CPACK_RPM_PACKAGE_AUTOPROV YES )
61- set (CPACK_RPM_PACKAGE_RELEASE_DIST ON )
62- endif ()
72+ cpack_add_component(OpenXRay
73+ DISPLAY_NAME "OpenXRay"
74+ DESCRIPTION "The main OpenXRay package that includes binary files to run the game."
75+ REQUIRED
76+ )
6377
64- include (CPack)
78+ cpack_add_component(Debug
79+ DISPLAY_NAME "Debug"
80+ DESCRIPTION "Debug symbols for engine developers needs."
81+ )
6582endif ()
0 commit comments