From dd998e7fd315b2f81e628c98c6b885ca20a6c6ed Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 12 Mar 2012 16:40:29 +0000 Subject: [PATCH] [trunk] Add support for compiling libtiff with VS2008 --- thirdparty/libtiff/CMakeLists.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/thirdparty/libtiff/CMakeLists.txt b/thirdparty/libtiff/CMakeLists.txt index 62963711..98e1efa7 100644 --- a/thirdparty/libtiff/CMakeLists.txt +++ b/thirdparty/libtiff/CMakeLists.txt @@ -173,6 +173,33 @@ if(HAVE_STDINT_H) set(TIFF_UINT64_FORMAT "\"%lu\"") set(TIFF_PTRDIFF_FORMAT "\"%ld\"") set(TIFF_SSIZE_FORMAT "\"%ld\"") +else() + set(TIFF_INT8_T signed __int8) + set(TIFF_INT16_T signed __int16) + set(TIFF_INT32_T signed __int32) + set(TIFF_INT64_T signed __int64) + set(TIFF_UINT8_T unsigned __int8) + set(TIFF_UINT16_T unsigned __int16) + set(TIFF_UINT32_T unsigned __int32) + set(TIFF_UINT64_T unsigned __int64) + set(TIFF_PTRDIFF_T ptrdiff_t) + if(NOT HAVE_SSIZE_T) + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(TIFF_SSIZE_T signed __int64) + elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 4) + set(TIFF_SSIZE_T signed __int32) + 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() #