diff options
author | Brad King <brad.king@kitware.com> | 2017-03-30 13:05:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-03-30 13:05:06 (GMT) |
commit | cb0f3cbb8e2e34e1948598355e151aee4953f7f6 (patch) | |
tree | 686a7e564ad0e4de30833fa267764eee781f6e0a | |
parent | 1cc918a770bf6dc763b593df39946667dc572c7d (diff) | |
parent | 01a8a201a7549369ea331516f8c6caa459074a8a (diff) | |
download | CMake-cb0f3cbb8e2e34e1948598355e151aee4953f7f6.zip CMake-cb0f3cbb8e2e34e1948598355e151aee4953f7f6.tar.gz CMake-cb0f3cbb8e2e34e1948598355e151aee4953f7f6.tar.bz2 |
Merge topic '10749-aix-version'
01a8a201 AIX: Properly detect host system version
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !645
-rw-r--r-- | Modules/CMakeDetermineSystem.cmake | 10 |
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) |