summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-05-02 14:33:18 (GMT)
committerBrad King <brad.king@kitware.com>2011-05-02 14:33:18 (GMT)
commit0bfabf967fa6efdcac40f3f2e3731795eaab9256 (patch)
tree4cd930fa862c65afa6befaa4dcfe8cff6a67a350 /Modules/CMakeDetermineSystem.cmake
parent9ea53478a6e102149f59499e48010a5bc8ab5c1f (diff)
downloadCMake-0bfabf967fa6efdcac40f3f2e3731795eaab9256.zip
CMake-0bfabf967fa6efdcac40f3f2e3731795eaab9256.tar.gz
CMake-0bfabf967fa6efdcac40f3f2e3731795eaab9256.tar.bz2
OpenBSD: Use 'arch -s' for host processor (#12143)
On OpenBSD 'uname -p' returns a long descriptive name for the processor. Use 'arch -s' instead to get a short cpu name. Suggested-by: Stuart Henderson
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 0e65bce..7ae3775 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")