CMakeLists.txt 3.11 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
PROJECT(ICE)

# Version
SET(ICE_YEAR 03)
SET(ICE_MONTH 08)
SET(ICE_VERSION
  "${ICE_YEAR}.${ICE_MONTH}")

# System to Build
STRING(REGEX REPLACE "-" "_" ICE_SYSTEM ${CMAKE_SYSTEM_NAME})

SET(ARCH_TO_BUILD ${ICE_SYSTEM} CACHE INTERNAL "Host Arcitecture : Linux IRIXN32 IRIX64 AIX CYGWIN")
# Allow the user to customize their build with some local options
#
ADD_DEFINITIONS(-D${ARCH_TO_BUILD})

17
18
19
20
21
22
SET(ICE_SIZEOF_CHAR   ${VTK_SIZEOF_CHAR})
SET(ICE_SIZEOF_DOUBLE ${VTK_SIZEOF_DOUBLE})
SET(ICE_SIZEOF_FLOAT  ${VTK_SIZEOF_FLOAT})
SET(ICE_SIZEOF_INT    ${VTK_SIZEOF_INT})
SET(ICE_SIZEOF_LONG   ${VTK_SIZEOF_LONG})
SET(ICE_SIZEOF_SHORT  ${VTK_SIZEOF_SHORT})
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
IF(WIN32)
  CHECK_TYPE_SIZE(__int64        SIZEOF___INT64)
ENDIF(WIN32)
CHECK_TYPE_SIZE("long long"    SIZEOF_LONG_LONG)
CHECK_FUNCTION_EXISTS(strtoll HAVE_STRTOLL)

# 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  "char")
SET(ICE_8_U_INT  "unsigned char")
SET(ICE_16_INT_VALID 1)
SET(ICE_16_INT "short")
SET(ICE_16_U_INT "unsigned short")
# 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)

INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
INCLUDE(${Xdmf_SOURCE_DIR}/CMake/CheckFor64BitStreams.cmake)
CHECK_FOR_64BIT_STREAMS(ICE_HAVE_64BIT_STREAMS)

# 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)
MARK_AS_ADVANCED(ICE_HAVE_FCNTL ICE_HAVE_NETINET ICE_HAVE_MMAN)

#Create IceConfig.h 
CONFIGURE_FILE(
  ${ICE_SOURCE_DIR}/IceConfig.h.in
  ${ICE_BINARY_DIR}/IceConfig.h
  )

IF(NOT XDMF_INSTALL_NO_DEVELOPMENT)
Burlen Loring's avatar
   
Burlen Loring committed
93
94
95
  FILE(GLOB devFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
  INSTALL(
      FILES ${devFiles}
96
97
      DESTINATION ${XDMF_INSTALL_INCLUDE_DIR}
      COMPONENT Development)
Burlen Loring's avatar
   
Burlen Loring committed
98
#   INSTALL_FILES(${XDMF_INSTALL_INCLUDE_DIR} .h IceConfig ice)
99
ENDIF(NOT XDMF_INSTALL_NO_DEVELOPMENT)