Commit c9bbbd0b authored by Jerry Clarke's avatar Jerry Clarke
Browse files

allow Cmake to generate IceConfig.h

parent f497844a
PROJECT(ICE)
# Version
SET(ICE_YEAR 03)
SET(ICE_MONTH 08)
SET(ICE_VERSION
"${ICE_YEAR}.${ICE_MONTH)")
# Platform configuration tests.
INCLUDE(${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityC.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
# System to Build
SET(ICE_SYSTEM ${CMAKE_SYSTEM_NAME})
SET(ARCH_TO_BUILD ${ICE_SYSTEM} CACHE STRING "Host Arcitecture : Linux IRIXN32 IRIX64 AIX CYGWIN")
# Allow the user to customize their build with some local options
#
ADD_DEFINITIONS(-D${ARCH_TO_BUILD})
MESSAGE(STATUS "Finding Atomic Data Sizes")
SET(ICE_SIZEOF_CHAR ${CMAKE_SIZEOF_CHAR})
SET(ICE_SIZEOF_DOUBLE ${CMAKE_SIZEOF_DOUBLE})
SET(ICE_SIZEOF_FLOAT ${CMAKE_SIZEOF_FLOAT})
SET(ICE_SIZEOF_INT ${CMAKE_SIZEOF_INT})
SET(ICE_SIZEOF_LONG ${CMAKE_SIZEOF_LONG})
SET(ICE_SIZEOF_SHORT ${CMAKE_SIZEOF_SHORT})
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
MESSAGE(STATUS "Finding a 64 Bit Integer")
CHECK_TYPE_SIZE(__int64 SIZEOF___INT64)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
# Don't Really Need to check these ...
SET(ICE_VOID_VALID 1)
SET(ICE_VOID "void")
SET(ICE_PTR_VALID 1)
SET(ICE_PTR "void *")
SET(ICE_CHAR_VALID 1)
SET(ICE_CHAR "char")
SET(ICE_8_INT_VALID 1)
SET(ICE_8_INT "unsigned char")
# These should be Valid
IF(${ICE_SIZEOF_FLOAT} MATCHES 4)
SET(ICE_32_FLOAT_VALID 1)
SET(ICE_FLOAT "float")
SET(ICE_32_FLOAT "float")
ELSE (${ICE_SIZEOF_FLOAT} MATCHES 4)
MESSAGE(SEND_ERROR "Can't Find a 32 Bit Float")
ENDIF (${ICE_SIZEOF_FLOAT} MATCHES 4)
IF(${ICE_SIZEOF_DOUBLE} MATCHES 8)
SET(ICE_64_FLOAT_VALID 1)
SET(ICE_DOUBLE "double")
SET(ICE_64_FLOAT "double")
ELSE (${ICE_SIZEOF_DOUBLE} MATCHES 8)
MESSAGE(SEND_ERROR "Can't Find a 64 Bit Float")
ENDIF (${ICE_SIZEOF_DOUBLE} MATCHES 8)
# These are sometimes different
IF(${ICE_SIZEOF_INT} MATCHES 4)
SET(ICE_32_INT_VALID 1)
SET(ICE_32_INT "int")
SET(ICE_32_U_INT "unsigned int")
SET(ICE_32_S_INT "int")
ELSE (${ICE_SIZEOF_INT} MATCHES 4)
IF(${ICE_SIZEOF_LONG} MATCHES 4)
SET(ICE_32_INT_VALID 1)
SET(ICE_32_INT "long")
SET(ICE_32_U_INT "unsigned long")
SET(ICE_32_S_INT "long")
ELSE(${ICE_SIZEOF_LONG} MATCHES 4)
MESSAGE(SEND_ERROR "Can't Find a 32 Bit Integer")
ENDIF(${ICE_SIZEOF_LONG} MATCHES 4)
ENDIF(${ICE_SIZEOF_INT} MATCHES 4)
# Find include files
FIND_PATH(ICE_HAVE_FCNTL fcntl.h /usr/include /usr/include/sys)
FIND_PATH(ICE_HAVE_NETINET in.h /usr/include/netinet /usr/include /usr/include/sys)
FIND_PATH(ICE_HAVE_MMAN mman.h /usr/include/sys /usr/include)
#Create IceConfig.h
CONFIGURE_FILE(
${ICE_SOURCE_DIR}/IceConfig.h.in
${ICE_BINARY_DIR}/IceConfig.h
)
/********************************************************/
/* */
/* ICE Host Dependent Configuration File */
/* Automatically Generated by CMake */
/* */
/********************************************************/
#ifndef __ICE_CONFIG
#define __ICE_CONFIG
/* what byte order */
#cmakedefine CMAKE_WORDS_BIGENDIAN
#ifdef CMAKE_WORDS_BIGENDIAN
#define ICE_WORDS_BIGENDIAN
#define ICE_BYTE_ORDER_BIG
#else
#define ICE_WORDS_LITTLEENDIAN
#define ICE_BYTE_ORDER_LITTLE
#endif
#define ICE_SYSTEM "@ICE_SYSTEM@"
#define ICE_HOST @ICE_SYSTEM@
#cmakedefine ICE_VOID_VALID
#ifndef ICE_VOID_VALID
/* Force an Error */
#error ICE_VOID not defined
#endif
#define ICE_VOID @ICE_VOID@
#cmakedefine ICE_PTR_VALID
#ifndef ICE_PTR_VALID
/* Force an Error */
#error ICE_PTR not defined
#endif
#define ICE_PTR @ICE_PTR@
#cmakedefine ICE_CHAR_VALID
#ifndef ICE_CHAR_VALID
/* Force an Error */
#error ICE_CHAR not defined
#endif
#define ICE_CHAR @ICE_CHAR@
#cmakedefine ICE_8_INT_VALID
#ifndef ICE_8_INT_VALID
/* Force an Error */
#error ICE_8_INT not defined
#endif
#define ICE_8_INT @ICE_8_INT@
#cmakedefine ICE_32_INT_VALID
#ifndef ICE_32_INT_VALID
/* Force an Error */
#error ICE_32_INT not defined
#endif
#define ICE_32_INT @ICE_32_INT@
#define ICE_32_U_INT @ICE_32_U_INT@
#define ICE_32_S_INT @ICE_32_S_INT@
#cmakedefine ICE_32_FLOAT_VALID
#ifndef ICE_32_FLOAT_VALID
/* Force an Error */
#error ICE_32_FLOAT not defined
#endif
#define ICE_32_FLOAT @ICE_32_FLOAT@
#define ICE_FLOAT @ICE_32_FLOAT@
#cmakedefine ICE_64_FLOAT_VALID
#ifndef ICE_64_FLOAT_VALID
/* Force an Error */
#error ICE_64_FLOAT not defined
#endif
#define ICE_64_FLOAT @ICE_64_FLOAT@
#define ICE_DOUBLE @ICE_64_FLOAT@
#ifndef SIZEOF___INT64
#cmakedefine SIZEOF___INT64
#endif
#ifndef SIZEOF_LONG_LONG
#cmakedefine SIZEOF_LONG_LONG
#endif
#if defined( SIZEOF___INT64 )
# define ICE_64_INT __int64
# define HAVE_64_INT
#elif defined( SIZEOF_LONG_LONG )
# define ICE_64_INT long long
# define HAVE_64_INT
#else
# error "64 bit long not defined"
#endif
#cmakedefine ICE_HAVE_FCNTL
#cmakedefine ICE_HAVE_NETINET
#cmakedefine ICE_HAVE_MMAN
#endif /* __ICE_CONFIG */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment