From da1c7787659973b2ace32731f0eb7d1bfeecd340 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 26 Sep 2011 15:09:09 +0200 Subject: move cmake endianess detection to proper place and actually USE it --- CMakeLists.txt | 8 ++++---- src/CMakeLists.txt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a13546e..342ff91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,10 @@ To do so, perform the following steps in the base directory: Then, run cmake again.") ENDIF() +INCLUDE (TestBigEndian) +TEST_BIG_ENDIAN(endianess) +SET ( PLIST_BYTE_ORDER ${endianess} ) + ADD_SUBDIRECTORY( libcnary ) ADD_SUBDIRECTORY( src ) ADD_SUBDIRECTORY( plutil ) @@ -49,10 +53,6 @@ IF ( SWIG_FOUND AND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND ) ADD_SUBDIRECTORY( swig ) ENDIF ( SWIG_FOUND AND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND ) -INCLUDE (TestBigEndian) -TEST_BIG_ENDIAN(endianess) -SET ( PLIST_BYTE_ORDER ${endianess} ) - # add uninstall target CONFIGURE_FILE( "${CMAKE_SOURCE_DIR}/cmake/modules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a0d6179..0de4c8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,6 +34,7 @@ SET(libcnary_object_files SET_SOURCE_FILES_PROPERTIES(${libcnary_object_files} PROPERTIES EXTERNAL_OBJECT true GENERATED true) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLIST_BYTE_ORDER=${PLIST_BYTE_ORDER}") ADD_LIBRARY( plist SHARED ${libplist_SRC} ${libcnary_object_files} ) TARGET_LINK_LIBRARIES( plist ${LIBXML2_LIBRARIES} ) SET_TARGET_PROPERTIES( plist PROPERTIES VERSION ${LIBPLIST_LIBVERSION} ) -- cgit v1.1-32-gdbae