summaryrefslogtreecommitdiffstats
path: root/Modules/TestBigEndian.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-08 15:59:07 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-08 15:59:07 (GMT)
commit8149dbed29973c2f37dcea0357cdb94ad84ecfb1 (patch)
tree80720127011181188b234a140b5346d38e79d09a /Modules/TestBigEndian.cmake
parent565ed7d8a184fdf4157f4c2c4fabe1ce4b07fde3 (diff)
downloadCMake-8149dbed29973c2f37dcea0357cdb94ad84ecfb1.zip
CMake-8149dbed29973c2f37dcea0357cdb94ad84ecfb1.tar.gz
CMake-8149dbed29973c2f37dcea0357cdb94ad84ecfb1.tar.bz2
ENH: Cleanups and add missing CMakeOutput.log and CMakeError.log appending. Close Bug #136 - Verify that all modules that do try compile produce CMakeError.log and CMakeOutput.log
Diffstat (limited to 'Modules/TestBigEndian.cmake')
-rw-r--r--Modules/TestBigEndian.cmake34
1 files changed, 26 insertions, 8 deletions
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 417e754..3f6d719 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -5,12 +5,30 @@
#
MACRO(TEST_BIG_ENDIAN VARIABLE)
- TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
- ${CMAKE_BINARY_DIR}
- ${CMAKE_ROOT}/Modules/TestBigEndian.c
- OUTPUT_VARIABLE OUTPUT)
- IF(NOT HAVE_${VARIABLE})
- FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
- "Determining the endianes of the system failed with the following output:\n${OUTPUT}\n\n")
- ENDIF(NOT HAVE_${VARIABLE})
+ IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
+ TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_ROOT}/Modules/TestBigEndian.c
+ OUTPUT_VARIABLE OUTPUT)
+ MESSAGE(STATUS "Check if the system is big endian")
+ IF(HAVE_${VARIABLE})
+ FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
+ "Determining the endianes of the system passed. The system is ")
+ IF(${VARIABLE})
+ FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
+ "big endian")
+ MESSAGE(STATUS "Check if the system is big endian - big endian")
+ ELSE(${VARIABLE})
+ FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
+ "little endian")
+ MESSAGE(STATUS "Check if the system is big endian - little endian")
+ ENDIF(${VARIABLE})
+ FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
+ "Test produced following output:\n${OUTPUT}\n\n")
+ ELSE(HAVE_${VARIABLE})
+ FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
+ "Determining the endianes of the system failed with the following output:\n${OUTPUT}\n\n")
+ MESSAGE("Check if the system is big endian - failed")
+ ENDIF(HAVE_${VARIABLE})
+ ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
ENDMACRO(TEST_BIG_ENDIAN)