diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-05-14 23:17:14 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-05-14 23:17:14 (GMT) |
commit | 6782a6a14cceaef5eee8c4dc3ca8dfc92df36de8 (patch) | |
tree | a5868e832f4a6919fdbb1ce36c63c96fbc2dbf7d | |
parent | 3d4c7887378bb3f0d486f7ec8166161f0b639c06 (diff) | |
download | CMake-6782a6a14cceaef5eee8c4dc3ca8dfc92df36de8.zip CMake-6782a6a14cceaef5eee8c4dc3ca8dfc92df36de8.tar.gz CMake-6782a6a14cceaef5eee8c4dc3ca8dfc92df36de8.tar.bz2 |
ENH: move from main tree handle uname without -p correctly
-rw-r--r-- | Modules/CMakeDetermineSystem.cmake | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index fc13071..4bc5ea3 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -31,16 +31,19 @@ IF(UNIX) IF(CMAKE_UNAME) EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_SYSTEM_NAME) EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION) - EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) - IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "--help") - EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR) - ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "--help") - IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "--help") + EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR + RETURN_VALUE val) + IF(${val} GREATER 0) + EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR + RETURN_VALUE val) + ENDIF(${val} GREATER 0) + IF(${val} GREATER 0) SET(CMAKE_SYSTEM_PROCESSOR "unknown") - ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "--help") + ENDIF(${val} GREATER 0) SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command") # processor may have double quote in the name, and that needs to be removed STRING(REGEX REPLACE "\"" "" CMAKE_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}") + STRING(REGEX REPLACE "/" "_" CMAKE_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}") ENDIF(CMAKE_UNAME) ELSE(UNIX) IF(WIN32) |