TestBigEndian.cmake 530 B

1234567891011121314151617
  1. #
  2. # Check if the system is big endian or little endian
  3. #
  4. # VARIABLE - variable to store the result to
  5. #
  6. MACRO(TEST_BIG_ENDIAN VARIABLE)
  7. TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
  8. ${CMAKE_BINARY_DIR}
  9. ${CMAKE_ROOT}/Modules/TestBigEndian.c
  10. OUTPUT_VARIABLE OUTPUT)
  11. IF(NOT HAVE_${VARIABLE})
  12. WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
  13. "Determining the endianes of the system failed with the following output:\n${OUTPUT}\n"
  14. APPEND)
  15. ENDIF(NOT HAVE_${VARIABLE})
  16. ENDMACRO(TEST_BIG_ENDIAN)