diff options
-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) |