Fix cmake detection of build platform endianness

Improve comments to indicate actual usage of WORDS_BIGENDIAN where
it is tested with #ifdef rather than #if
This commit is contained in:
Stuart Cunningham 2014-02-13 22:59:30 +11:00
parent 5d43d3ca88
commit 55b9c0374c
4 changed files with 10 additions and 14 deletions

View File

@ -6,7 +6,6 @@ project(${TIFF_LIBRARY})
include(CheckFunctionExists)
include(CheckIncludeFile)
include(TestBigEndian)
check_include_file(assert.h HAVE_ASSERT_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
@ -17,7 +16,6 @@ check_include_file(search.h HAVE_SEARCH_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
test_big_endian(HOST_BIGENDIAN)
if(WIN32 AND NOT HAVE_WINRT)
set(USE_WIN32_FILEIO 1)

View File

@ -54,7 +54,7 @@
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN @HOST_BIGENDIAN@
#define HOST_BIGENDIAN @WORDS_BIGENDIAN@
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
@ -154,17 +154,9 @@
/* define to use win32 IO system */
#cmakedefine USE_WIN32_FILEIO
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
/* Define WORDS_BIGENDIAN if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
#cmakedefine WORDS_BIGENDIAN
/* Support Deflate compression */
#define ZIP_SUPPORT 1

View File

@ -444,6 +444,12 @@ endif()
include(cmake/OpenCVPCHSupport.cmake)
include(cmake/OpenCVModule.cmake)
# ----------------------------------------------------------------------------
# Detect endianness of build platform
# ----------------------------------------------------------------------------
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
# ----------------------------------------------------------------------------
# Detect 3rd-party libraries
# ----------------------------------------------------------------------------

View File

@ -161,6 +161,6 @@
/* Xine video library */
#cmakedefine HAVE_XINE
/* Define to 1 if your processor stores words with the most significant byte
/* Define if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine WORDS_BIGENDIAN