diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 0e65bceae..7ae377517 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -50,14 +50,17 @@ IF(CMAKE_HOST_UNIX) IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) - ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") + ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD") + EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR + RETURN_VALUE val) + ELSE() EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) IF("${val}" GREATER 0) EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) ENDIF("${val}" GREATER 0) - ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") + ENDIF() # check the return of the last uname -m or -p IF("${val}" GREATER 0) SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")