diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2007-02-21 15:29:36 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2007-02-21 15:29:36 (GMT) |
commit | d7b5020a2e9deb4f2c74330263d9243a40da25e6 (patch) | |
tree | 05c04a1b0a06820bb3c8ec75c512b06499274d38 | |
parent | 086da498d4473ad556c61d5e1622d78794912fc7 (diff) | |
download | CMake-d7b5020a2e9deb4f2c74330263d9243a40da25e6.zip CMake-d7b5020a2e9deb4f2c74330263d9243a40da25e6.tar.gz CMake-d7b5020a2e9deb4f2c74330263d9243a40da25e6.tar.bz2 |
ENH: better processor detection on linux
-rw-r--r-- | Modules/CMakeDetermineSystem.cmake | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index a2c22b4..e7559e2 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -25,20 +25,25 @@ # Ultrix ULTRIX # cygwin CYGWIN_NT-5.1 # MacOSX Darwin - IF(UNIX) FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) 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 - RETURN_VALUE val) - IF("${val}" GREATER 0) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR RETURN_VALUE val) - ENDIF("${val}" GREATER 0) + ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") + 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) + ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") + # check the return of the last uname -m or -p IF("${val}" GREATER 0) - SET(CMAKE_SYSTEM_PROCESSOR "unknown") + SET(CMAKE_SYSTEM_PROCESSOR "unknown") 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 |