summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-03-29 19:14:36 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2017-03-29 19:20:23 (GMT)
commit01a8a201a7549369ea331516f8c6caa459074a8a (patch)
tree4a2f52eb7a732caa3e9f607a50ec1492bb82fa22 /Modules/CMakeDetermineSystem.cmake
parent6a5a214f43cccc83fbe3dd6de4747aba43088701 (diff)
downloadCMake-01a8a201a7549369ea331516f8c6caa459074a8a.zip
CMake-01a8a201a7549369ea331516f8c6caa459074a8a.tar.gz
CMake-01a8a201a7549369ea331516f8c6caa459074a8a.tar.bz2
AIX: Properly detect host system version
CMakeDetermineSystem.cmake uses "uname -r" to get CMAKE_HOST_SYSTEM_VERSION on AIX. AIX uses "uname -v" for the major version and "uname -r" for the minor version. Thanks to Chris Taylor for the suggested patch. Closes #10749
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index f34ec5d..20dcf1b 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -35,7 +35,15 @@
if(CMAKE_HOST_UNIX)
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if(CMAKE_UNAME)
- exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "AIX")
+ exec_program(${CMAKE_UNAME} ARGS -v OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MAJOR_VERSION)
+ exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MINOR_VERSION)
+ set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}")
+ unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION)
+ unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION)
+ else()
+ exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+ endif()
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$")
exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)