Add: [CMake] support rpm for fedora and rhel (#9861)

This commit is contained in:
Nik Nyby 2022-04-18 20:11:42 -04:00 committed by GitHub
parent 6204020b6a
commit 44713a68ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -129,7 +129,7 @@ if(APPLE)
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-universal")
else()
set(CPACK_PACKAGE_FILE_NAME "openttd-#CPACK_PACKAGE_VERSION#-macos-${CPACK_SYSTEM_NAME}")
endif()
endif()
elseif(WIN32)
set(CPACK_GENERATOR "ZIP")
if(OPTION_USE_NSIS)
@ -181,6 +181,10 @@ elseif(UNIX)
if(DISTRO_ID STREQUAL "arch")
set(PLATFORM "arch")
set(CPACK_GENERATOR "TXZ")
elseif(DISTRO_ID STREQUAL "fedora" OR DISTRO_ID STREQUAL "rhel")
set(PLATFORM "fedora")
set(CPACK_GENERATOR "RPM")
include(PackageRPM)
else()
set(UNSUPPORTED_PLATFORM_NAME "Linux distribution '${DISTRO_ID}' from /etc/os-release")
endif()

1
cmake/PackageRPM.cmake Normal file
View File

@ -0,0 +1 @@
set(CPACK_RPM_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")