summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-05-14 21:42:27 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-05-14 21:42:27 (GMT)
commit21564b4d616299c3602d2969f1a5a03337188810 (patch)
tree2ee8ac2907d5fa14ba2d26623d5a8542d891b593 /Modules/CMakeDetermineSystem.cmake
parentb2c8f4d800d32110329794cda407d219ce139a50 (diff)
downloadCMake-21564b4d616299c3602d2969f1a5a03337188810.zip
CMake-21564b4d616299c3602d2969f1a5a03337188810.tar.gz
CMake-21564b4d616299c3602d2969f1a5a03337188810.tar.bz2
ENH: check return value for uname -p
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake15
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)