From e3dc55ccce639ee98c99a71ea3f6755729b61d07 Mon Sep 17 00:00:00 2001 From: Navarrop Date: Thu, 23 Jun 2011 11:18:16 +0200 Subject: [PATCH] Find the system processor to know if we have raw ctx. --- buildtools/Cmake/AddTests.cmake | 49 ++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index 5865d11cfe..ae05705b17 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -11,14 +11,49 @@ if(enable_smpi AND NOT WIN32) endif(enable_smpi AND NOT WIN32) -if(${PROCESSOR_x86_64}) - set(HAVE_RAWCTX 1) -endif(${PROCESSOR_x86_64}) -if(${PROCESSOR_i686}) - set(HAVE_RAWCTX 1) -endif(${PROCESSOR_i686}) +IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + message(STATUS"System processor: amd64") + set(HAVE_RAWCTX 1) +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") + message(STATUS"System processor: i386") + set(HAVE_RAWCTX 1) +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha") + message(STATUS"System processor: alpha") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") + # Subdir is "arm" for both big-endian (arm) and little-endian (armel). + message(STATUS"System processor: arm") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") + # mips* machines are bi-endian mostly so processor does not tell + # endianess of the underlying system. + message(STATUS"System processor: ${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") + message(STATUS"System processor: ppc64") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") + message(STATUS"System processor: ppc") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") + # Both flavours can run on the same processor + message(STATUS"System processor: ${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)") + message(STATUS"System processor: parisc" "parisc64") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390") + # s390 binaries can run on s390x machines + message(STATUS"System processor: ${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x") + +ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh") + message(STATUS"System processor: sh") + +ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #PROCESSOR NOT fIND + message("PROCESSOR NOT FIND: ${CMAKE_SYSTEM_PROCESSOR}") + +ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - ### For code coverage ### Set some variables SET(UPDATE_TYPE "svn") -- 2.20.1