diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-10-01 19:56:18 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-10-01 19:56:18 (GMT) |
commit | dfb25dd982b90403643c39b20232da5ee1283579 (patch) | |
tree | dca77ef6c844f18ec5a29167e8d3f5e844404791 /Modules/TestBigEndian.cmake | |
parent | 4045066f0175e82220d4abaa189b80ca15f31166 (diff) | |
download | CMake-dfb25dd982b90403643c39b20232da5ee1283579.zip CMake-dfb25dd982b90403643c39b20232da5ee1283579.tar.gz CMake-dfb25dd982b90403643c39b20232da5ee1283579.tar.bz2 |
Add test for big endian
Diffstat (limited to 'Modules/TestBigEndian.cmake')
-rw-r--r-- | Modules/TestBigEndian.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake new file mode 100644 index 0000000..c729a82 --- /dev/null +++ b/Modules/TestBigEndian.cmake @@ -0,0 +1,16 @@ +# +# 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} + ${PROJECT_BINARY_DIR} + ${CMAKE_ROOT}/Modules/TestBigEndian.c + OUTPUT_VARIABLE OUTPUT) + IF(NOT HAVE_${VARIABLE}) + WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log + "Determining the endianes of the system failed with the following output:\n${OUTPUT}\n") + ENDIF(NOT HAVE_${VARIABLE}) +ENDMACRO(TEST_BIG_ENDIAN) |