2002-10-01 23:56:18 +04:00
|
|
|
#
|
|
|
|
# Check if the system is big endian or little endian
|
|
|
|
#
|
|
|
|
# VARIABLE - variable to store the result to
|
|
|
|
#
|
|
|
|
|
|
|
|
MACRO(TEST_BIG_ENDIAN VARIABLE)
|
|
|
|
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
|
2003-07-11 22:14:03 +04:00
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_ROOT}/Modules/TestBigEndian.c
|
|
|
|
OUTPUT_VARIABLE OUTPUT)
|
2002-10-01 23:56:18 +04:00
|
|
|
IF(NOT HAVE_${VARIABLE})
|
2003-07-11 22:14:03 +04:00
|
|
|
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
2003-07-17 22:55:45 +04:00
|
|
|
"Determining the endianes of the system failed with the following output:\n${OUTPUT}\n\n")
|
2002-10-01 23:56:18 +04:00
|
|
|
ENDIF(NOT HAVE_${VARIABLE})
|
|
|
|
ENDMACRO(TEST_BIG_ENDIAN)
|