ERR: On systems where uname does not support -p, try -m. Fixes Bug #426 - CMAKE_SYSTEM_PROCESSOR unknown and inconsistent

This commit is contained in:
Andy Cedilnik 2003-12-29 14:26:46 -05:00
parent de30a184a2
commit 46aaf2dae8
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,12 @@ IF(UNIX)
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")
SET(CMAKE_SYSTEM_PROCESSOR "unknown")
ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "--help")
SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
ENDIF(CMAKE_UNAME)
ELSE(UNIX)