INCLUDE (CheckTypeSize)

CHECK_TYPE_SIZE(int SIZEOF_INT)
CHECK_TYPE_SIZE(long SIZEOF_LONG)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
CHECK_TYPE_SIZE("void *" SIZEOF_VOID_P)

# Sets Bits variables
# check 64 bit
IF( CMAKE_SIZEOF_VOID_P EQUAL 4 )
	SET( HAVE_64_BIT 0 )
	SET( BITS 32 )
ELSE()
	SET( HAVE_64_BIT 1 )
	ADD_DEFINITIONS(-DHAVE_64_BIT)
	SET( BITS 64)
ENDIF()

# Check endian of the system
INCLUDE (TestBigEndian)
TEST_BIG_ENDIAN (IS_BIG_ENDIAN)
IF (IS_BIG_ENDIAN)
    ADD_DEFINITIONS(-DENDIAN_IS_BIG)
   # cannot use BIG_ENDIAN because it's reserved in Linux
ELSE ()
    ADD_DEFINITIONS(-DENDIAN_IS_LITTLE)
   # cannot use LITTLE_ENDIAN because it's reserved in Linux
ENDIF () # IS_BIG_ENDIAN

