set(SUBIFD_SUPPORT 1)
set(THUNDER_SUPPORT 1)
-if(HAVE_STDINT_H)
- set(TIFF_INT8_T int8_t)
- set(TIFF_INT16_T int16_t)
- set(TIFF_INT32_T int32_t)
- set(TIFF_INT64_T int64_t)
- set(TIFF_UINT8_T uint8_t)
- set(TIFF_UINT16_T uint16_t)
- set(TIFF_UINT32_T uint32_t)
- set(TIFF_UINT64_T uint64_t)
- set(TIFF_PTRDIFF_T ptrdiff_t)
- set(TIFF_SSIZE_T ssize_t)
- set(TIFF_INT32_FORMAT "\"%d\"")
- set(TIFF_UINT32_FORMAT "\"%u\"")
- set(TIFF_INT64_FORMAT "\"%ld\"")
- set(TIFF_UINT64_FORMAT "\"%lu\"")
- set(TIFF_PTRDIFF_FORMAT "\"%ld\"")
- set(TIFF_SSIZE_FORMAT "\"%ld\"")
-endif()
-
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_FUNCTION_EXISTS(isascii HAVE_ISASCII)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT)
CHECK_TYPE_SIZE("unsigned char*" SIZEOF_UNSIGNED_CHAR_P)
+# check platform has ssize_t:
+CHECK_TYPE_SIZE(ssize_t SSIZE_T)
+
+if(HAVE_STDINT_H)
+ set(TIFF_INT8_T int8_t)
+ set(TIFF_INT16_T int16_t)
+ set(TIFF_INT32_T int32_t)
+ set(TIFF_INT64_T int64_t)
+ set(TIFF_UINT8_T uint8_t)
+ set(TIFF_UINT16_T uint16_t)
+ set(TIFF_UINT32_T uint32_t)
+ set(TIFF_UINT64_T uint64_t)
+ set(TIFF_PTRDIFF_T ptrdiff_t)
+ if(NOT HAVE_SSIZE_T)
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ set(TIFF_SSIZE_T int64_t)
+ elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 4)
+ set(TIFF_SSIZE_T int32_t)
+ else()
+ message(FATAL_ERROR "unknown ssize_t")
+ endif()
+ else()
+ set(TIFF_SSIZE_T ssize_t)
+ endif()
+ set(TIFF_INT32_FORMAT "\"%d\"")
+ set(TIFF_UINT32_FORMAT "\"%u\"")
+ set(TIFF_INT64_FORMAT "\"%ld\"")
+ set(TIFF_UINT64_FORMAT "\"%lu\"")
+ set(TIFF_PTRDIFF_FORMAT "\"%ld\"")
+ set(TIFF_SSIZE_FORMAT "\"%ld\"")
+endif()
#
set(VERSION "\"4.0.1\"")
CHECK_SYMBOL_EXISTS(lfind "search.h" HAVE_LFIND)
CHECK_SYMBOL_EXISTS(setmod "io.h" HAVE_SETMODE)
+# http://www.cmake.org/pipermail/cmake/2007-September/016285.html
+FOREACH(KEYWORD "inline" "__inline__" "__inline")
+ IF(NOT DEFINED C_INLINE)
+ TRY_COMPILE(C_HAS_${KEYWORD} "${CMAKE_CURRENT_BINARY_DIR}"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_inline.c"
+ COMPILE_DEFINITIONS "-Dinline=${KEYWORD}")
+ IF(C_HAS_${KEYWORD})
+ SET(C_INLINE TRUE)
+ SET(INLINE "${KEYWORD}")
+ ENDIF(C_HAS_${KEYWORD})
+ ENDIF(NOT DEFINED C_INLINE)
+ENDFOREACH(KEYWORD)
+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmake.in