From 90723230b0530472834316f70318f75c565bd673 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 11 Sep 2013 22:49:00 +0200 Subject: [PATCH] Detect OS version when running on RHEL/CentOS 5.x These versions only have /etc/redhat-release, not any of the newer files. --- cmake/Modules/UseSystemInfo.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/UseSystemInfo.cmake b/cmake/Modules/UseSystemInfo.cmake index 0de83a64c..b4b3f8af8 100644 --- a/cmake/Modules/UseSystemInfo.cmake +++ b/cmake/Modules/UseSystemInfo.cmake @@ -39,6 +39,7 @@ function (distro_name varname) file (GLOB has_os_release /etc/os-release) file (GLOB has_lsb_release /etc/lsb-release) file (GLOB has_sys_release /etc/system-release) + file (GLOB has_redhat_release /etc/redhat-release) set (_descr) # start with /etc/os-release, # see @@ -52,6 +53,8 @@ function (distro_name varname) if (NOT _descr) if (NOT has_sys_release STREQUAL "") file (READ /etc/system-release _descr) + elseif (NOT has_redhat_release STREQUAL "") + file (READ /etc/redhat-release _descr) else (NOT has_sys_release STREQUAL "") # no yet known release file found set (_descr "unknown")