[opengtl-commits] [357] add a configure test for endianess

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 357
Author:   cyrille
Date:     2008-09-03 23:03:31 +0200 (Wed, 03 Sep 2008)

Log Message:
-----------
add a configure test for endianess

Modified Paths:
--------------
    trunk/OpenGTL/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/config-endian.h.cmake


Modified: trunk/OpenGTL/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/CMakeLists.txt	2008-09-03 20:53:32 UTC (rev 356)
+++ trunk/OpenGTL/CMakeLists.txt	2008-09-03 21:03:31 UTC (rev 357)
@@ -18,11 +18,16 @@
 set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/OpenGTL/)
 set(GTLIMAGEIO_EXTENSIONS_INSTALL_DIR ${SHARE_INSTALL_DIR}/GTLImageIO/Extensions)
 
+include (TestBigEndian)
+test_big_endian(CMAKE_WORDS_BIGENDIAN)
+configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )
+
 add_definitions(-Wall -Werror )
 
 find_package(LLVM REQUIRED)
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OpenGTL)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/OpenGTL ${CMAKE_CURRENT_BINARY_DIR}
+)
 
 add_subdirectory(OpenGTL)
 add_subdirectory(OpenCTL)

Added: trunk/OpenGTL/config-endian.h.cmake
===================================================================
--- trunk/OpenGTL/config-endian.h.cmake	                        (rev 0)
+++ trunk/OpenGTL/config-endian.h.cmake	2008-09-03 21:03:31 UTC (rev 357)
@@ -0,0 +1,11 @@
+#ifdef __APPLE__
+# ifdef __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# else
+#  undef WORDS_BIGENDIAN
+# endif
+#else
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+#cmakedefine WORDS_BIGENDIAN ${CMAKE_WORDS_BIGENDIAN}
+#endif


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/