# HG changeset patch # User Nik Nyby # Date 2022-04-19 00:11:42 # Node ID 12c5263cff207639e6b14d499d5aa4c0349491f1 # Parent 376eeb36a6811fb876ad79a0a2c494d49ce7719f Add: [CMake] support rpm for fedora and rhel (#9861) diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake --- a/cmake/InstallAndPackage.cmake +++ b/cmake/InstallAndPackage.cmake @@ -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() diff --git a/cmake/PackageRPM.cmake b/cmake/PackageRPM.cmake new file mode 100644 --- /dev/null +++ b/cmake/PackageRPM.cmake @@ -0,0 +1,1 @@ +set(CPACK_RPM_PACKAGE_ARCHITECTURE "${ARCHITECTURE}")