summaryrefslogtreecommitdiffstats
path: root/cmake/packaging.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/packaging.cmake')
-rw-r--r--cmake/packaging.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake
index a85ce33..0798b83 100644
--- a/cmake/packaging.cmake
+++ b/cmake/packaging.cmake
@@ -84,6 +84,12 @@ elseif(UNIX)
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
+ elseif(distribution MATCHES "RedHat.*")
+ # extract the major version from RedHat full version (e.g. 6.7 --> 6)
+ execute_process(COMMAND lsb_release -sr COMMAND sed s/[.].*// OUTPUT_VARIABLE redhat_version_major OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(CPACK_GENERATOR "RPM")
+ set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.el${redhat_version_major}.${CPACK_RPM_PACKAGE_ARCHITECTURE})
+
elseif(distribution MATCHES "openSUSE.*")
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${release}.${CPACK_RPM_PACKAGE_ARCHITECTURE})