More flexible tiff library configuration

This commit is contained in:
Andrey Kamaev 2012-03-01 09:01:32 +00:00
parent 92d2d74731
commit e8afcdba0a
4 changed files with 214 additions and 437 deletions

View File

@ -4,25 +4,36 @@
# ----------------------------------------------------------------------------
project(${TIFF_LIBRARY})
include(CheckFunctionExists)
include(CheckIncludeFile)
check_include_file(assert.h HAVE_ASSERT_H)
check_include_file(fcntl.h HAVE_FCNTL_H)
check_include_file(io.h HAVE_IO_H)
check_function_exists(jbg_newlen HAVE_JBG_NEWLEN)
check_function_exists(mmap HAVE_MMAP)
check_include_file(search.h HAVE_SEARCH_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
if(WIN32)
set(USE_WIN32_FILEIO 1)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmakein"
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" @ONLY)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
# List of C++ files:
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-DHAVE_STRING_H=1)
# The .cpp files:
set(lib_srcs
t4.h
tiffio.hxx
tiffiop.h
tif_aux.c
tif_close.c
tif_codec.c
tif_color.c
tif_compress.c
tif_dir.c
tif_dir.h
tif_dirinfo.c
tif_dirread.c
tif_dirwrite.c
@ -30,13 +41,14 @@ set(lib_srcs
tif_error.c
tif_extension.c
tif_fax3.c
tif_fax3.h
tif_fax3sm.c
tif_flush.c
tif_getimage.c
tif_jbig.c
tif_jpeg_12.c
tif_jpeg.c
tif_luv.c
tif_lzma.c
tif_lzw.c
tif_next.c
tif_ojpeg.c
@ -44,10 +56,8 @@ set(lib_srcs
tif_packbits.c
tif_pixarlog.c
tif_predict.c
tif_predict.h
tif_print.c
tif_read.c
tif_stream.cxx
tif_strip.c
tif_swab.c
tif_thunder.c
@ -56,36 +66,42 @@ set(lib_srcs
tif_warning.c
tif_write.c
tif_zip.c
tif_stream.cxx
t4.h
tif_dir.h
tif_fax3.h
tiff.h
tiffio.h
tiffiop.h
tiffvers.h
tif_predict.h
uvcode.h
tiffio.hxx
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h"
)
if(UNIX)
set(lib_srcs ${lib_srcs} tif_unix.c)
list(APPEND lib_srcs tif_unix.c)
if(CMAKE_COMPILER_IS_GNUCXX)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-aliasing -Wno-int-to-pointer-cast")
set_source_files_properties(tif_unix.c PROPERTIES COMPILE_FLAGS "-w")
endif()
endif()
if(WIN32)
set(lib_srcs ${lib_srcs} tif_win32.c)
list(APPEND lib_srcs tif_win32.c)
endif(WIN32)
file(GLOB lib_hdrs *.h*)
if(MSVC)
string(REPLACE "/W4" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
if(CMAKE_COMPILER_IS_GNUCXX)
set_source_files_properties(tif_stream.cxx PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
set_target_properties(${TIFF_LIBRARY}
PROPERTIES
OUTPUT_NAME "${TIFF_LIBRARY}"

View File

@ -1,408 +0,0 @@
/* libtiff/tif_config.h. Generated from tif_config.h.in by configure. */
/* libtiff/tif_config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/* enable partial strip reading for large strips (experimental) */
/* #undef CHUNKY_STRIP_READ_SUPPORT */
/* Support C++ stream API (requires C++ compiler) */
#define CXX_SUPPORT 1
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* enable deferred strip/tile offset/size loading (experimental) */
/* #undef DEFER_STRILE_LOAD */
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `floor' function. */
#define HAVE_FLOOR 1
/* Define to 1 if you have the `getopt' function. */
#define HAVE_GETOPT 1
/* Define to 1 if you have the <GLUT/glut.h> header file. */
/* #undef HAVE_GLUT_GLUT_H */
/* Define to 1 if you have the <GL/glut.h> header file. */
#define HAVE_GL_GLUT_H 1
/* Define to 1 if you have the <GL/glu.h> header file. */
#define HAVE_GL_GLU_H 1
/* Define to 1 if you have the <GL/gl.h> header file. */
#define HAVE_GL_GL_H 1
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Define to 1 if the system has the type `int16'. */
/* #undef HAVE_INT16 */
/* Define to 1 if the system has the type `int32'. */
/* #undef HAVE_INT32 */
/* Define to 1 if the system has the type `int8'. */
/* #undef HAVE_INT8 */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define to 1 if you have the `isascii' function. */
#define HAVE_ISASCII 1
/* Define to 1 if you have the `jbg_newlen' function. */
/* #undef HAVE_JBG_NEWLEN */
/* Define to 1 if you have the `lfind' function. */
#define HAVE_LFIND 1
/* Define to 1 if you have the `c' library (-lc). */
#define HAVE_LIBC 1
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define to 1 if you have the <OpenGL/glu.h> header file. */
/* #undef HAVE_OPENGL_GLU_H */
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
/* #undef HAVE_OPENGL_GL_H */
/* Define to 1 if you have the `pow' function. */
#define HAVE_POW 1
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
#if !__ANDROID__
/* Define to 1 if you have the <search.h> header file. */
#define HAVE_SEARCH_H 1
#endif
/* Define to 1 if you have the `setmode' function. */
/* #undef HAVE_SETMODE */
/* Define to 1 if you have the `sqrt' function. */
#define HAVE_SQRT 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the `strtoul' function. */
#define HAVE_STRTOUL 1
/* Define to 1 if you have the `strtoull' function. */
#define HAVE_STRTOULL 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Use nonstandard varargs form for the GLU tesselator callback */
/* #undef HAVE_VARARGS_GLU_TESSCB */
/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Support ISO JBIG compression (requires JBIG-KIT library) */
/* #undef JBIG_SUPPORT */
/* 8/12 bit libjpeg dual mode enabled */
/* #undef JPEG_DUAL_MODE_8_12 */
/* Support JPEG compression (requires IJG JPEG library) */
//#define JPEG_SUPPORT 1
/* 12bit libjpeg primary include file with path */
/* #undef LIBJPEG_12_PATH */
/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Support LZMA2 compression */
/* #undef LZMA_SUPPORT */
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support Microsoft Document Imaging format */
#define MDI_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Support Old JPEG compresson (read-only) */
//#define OJPEG_SUPPORT 1
/* Name of package */
#define PACKAGE "tiff"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "tiff@lists.maptools.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "LibTIFF Software"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "LibTIFF Software 4.0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "tiff"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "4.0.1"
/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1
/* Support Pixar log-format algorithm (requires Zlib) */
//#define PIXARLOG_SUPPORT 1
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* The size of `signed int', as computed by sizeof. */
#define SIZEOF_SIGNED_INT 4
/* The size of `signed long', as computed by sizeof. */
#define SIZEOF_SIGNED_LONG 8
/* The size of `signed long long', as computed by sizeof. */
#define SIZEOF_SIGNED_LONG_LONG 8
/* The size of `signed short', as computed by sizeof. */
#define SIZEOF_SIGNED_SHORT 2
/* The size of `unsigned char *', as computed by sizeof. */
#define SIZEOF_UNSIGNED_CHAR_P 8
/* The size of `unsigned int', as computed by sizeof. */
#define SIZEOF_UNSIGNED_INT 4
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 8
/* The size of `unsigned long long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG_LONG 8
/* The size of `unsigned short', as computed by sizeof. */
#define SIZEOF_UNSIGNED_SHORT 2
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of specified size to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
/* Default size of the strip in bytes (when strip chopping enabled) */
#define STRIP_SIZE_DEFAULT 8192
/* Enable SubIFD tag (330) support */
#define SUBIFD_SUPPORT 1
/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1
/* Signed 16-bit type */
#define TIFF_INT16_T signed short
/* Signed 32-bit type formatter */
#define TIFF_INT32_FORMAT "%d"
/* Signed 32-bit type */
#define TIFF_INT32_T signed int
/* Signed 64-bit type formatter */
#define TIFF_INT64_FORMAT "%ld"
/* Signed 64-bit type */
//#define TIFF_INT64_T signed long
/* Signed 8-bit type */
#define TIFF_INT8_T signed char
/* Pointer difference type formatter */
#define TIFF_PTRDIFF_FORMAT "%ld"
/* Pointer difference type */
#define TIFF_PTRDIFF_T ptrdiff_t
/* Signed size type formatter */
#define TIFF_SSIZE_FORMAT "%ld"
/* Signed size type */
#define TIFF_SSIZE_T size_t
/* Unsigned 16-bit type */
#define TIFF_UINT16_T unsigned short
/* Unsigned 32-bit type formatter */
#define TIFF_UINT32_FORMAT "%u"
/* Unsigned 32-bit type */
#define TIFF_UINT32_T unsigned int
/* Unsigned 64-bit type formatter */
#define TIFF_UINT64_FORMAT "%lu"
#ifdef _MSC_VER
/* Signed 64-bit type */
#define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type */
#define TIFF_UINT64_T unsigned __int64
#else
/* Signed 64-bit type */
#define TIFF_INT64_T long long
/* Signed 64-bit type */
#define TIFF_UINT64_T unsigned long long
#endif
/* Unsigned 64-bit type */
//#define TIFF_UINT64_T unsigned long
/* Unsigned 8-bit type */
#define TIFF_UINT8_T unsigned char
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* define to use win32 IO system */
/* #undef USE_WIN32_FILEIO */
/* Version number of package */
#define VERSION "4.0.1"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */
/* Support Deflate compression */
//#define ZIP_SUPPORT 1
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

169
3rdparty/libtiff/tif_config.h.cmakein vendored Normal file
View File

@ -0,0 +1,169 @@
/* libtiff/tif_config.h. Generated from tif_config.h.in by configure. */
/* libtiff/tif_config.h.in. Generated from configure.ac by autoheader. */
/* Support CCITT Group 3 & 4 algorithms */
#define CCITT_SUPPORT 1
/* Pick up YCbCr subsampling info from the JPEG data stream to support files
lacking the tag (default enabled). */
#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
/* enable partial strip reading for large strips (experimental) */
#undef CHUNKY_STRIP_READ_SUPPORT
/* Treat extra sample as alpha (default enabled). The RGBA interface will
treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
packages produce RGBA files but don't mark the alpha properly. */
#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
/* enable deferred strip/tile offset/size loading (experimental) */
#undef DEFER_STRILE_LOAD
/* Define to 1 if you have the <assert.h> header file. */
#cmakedefine HAVE_ASSERT_H
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H
/* Define as 0 or 1 according to the floating point format suported by the
machine */
#define HAVE_IEEEFP 1
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H
/* Define to 1 if you have the `jbg_newlen' function. */
#cmakedefine HAVE_JBG_NEWLEN
/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP
/* Define to 1 if you have the <search.h> header file. */
#cmakedefine HAVE_SEARCH_H
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H
/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
(Intel) */
#define HOST_BIGENDIAN 0
/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
#define HOST_FILLORDER FILLORDER_LSB2MSB
/* Support ISO JBIG compression (requires JBIG-KIT library) */
#undef JBIG_SUPPORT
/* 8/12 bit libjpeg dual mode enabled */
/* #undef JPEG_DUAL_MODE_8_12 */
/* Support JPEG compression (requires IJG JPEG library) */
#undef JPEG_SUPPORT
/* 12bit libjpeg primary include file with path */
/* #undef LIBJPEG_12_PATH */
/* Support LogLuv high dynamic range encoding */
#define LOGLUV_SUPPORT 1
/* Support LZMA2 compression */
/* #undef LZMA_SUPPORT */
/* Support LZW algorithm */
#define LZW_SUPPORT 1
/* Support Microsoft Document Imaging format */
#define MDI_SUPPORT 1
/* Support NeXT 2-bit RLE algorithm */
#define NEXT_SUPPORT 1
/* Support Old JPEG compresson (read-only) */
#undef OJPEG_SUPPORT
/* Support Macintosh PackBits algorithm */
#define PACKBITS_SUPPORT 1
/* Support Pixar log-format algorithm (requires Zlib) */
#define PIXARLOG_SUPPORT 1
/* The size of `unsigned long', as computed by sizeof. */
#define SIZEOF_UNSIGNED_LONG 8
/* Support strip chopping (whether or not to convert single-strip uncompressed
images to mutiple strips of specified size to reduce memory usage) */
#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
/* Default size of the strip in bytes (when strip chopping enabled) */
//#define STRIP_SIZE_DEFAULT 8192
/* Support ThunderScan 4-bit RLE algorithm */
#define THUNDER_SUPPORT 1
/* Signed 8-bit type */
#define TIFF_INT8_T signed char
/* Signed 16-bit type */
#define TIFF_INT16_T signed short
/* Signed 32-bit type */
#define TIFF_INT32_T signed int
/* Signed size type */
#define TIFF_SSIZE_T size_t
/* Unsigned 8-bit type */
#define TIFF_UINT8_T unsigned char
/* Unsigned 16-bit type */
#define TIFF_UINT16_T unsigned short
/* Unsigned 32-bit type */
#define TIFF_UINT32_T unsigned int
#ifdef _MSC_VER
/* Signed 64-bit type */
# define TIFF_INT64_T signed __int64
/* Unsigned 64-bit type */
# define TIFF_UINT64_T unsigned __int64
#else
/* Signed 64-bit type */
# define TIFF_INT64_T long long
/* Signed 64-bit type */
# define TIFF_UINT64_T unsigned long long
#endif
/* Signed 64-bit type formatter */
/* Unsigned 64-bit type formatter */
#ifdef _MSC_VER
# define TIFF_UINT64_FORMAT "%I64u"
# define TIFF_SSIZE_FORMAT "%Iu"
#else
# define TIFF_UINT64_FORMAT "%llu"
# define TIFF_SSIZE_FORMAT "%zd"
#endif
/* define to use win32 IO system */
#cmakedefine USE_WIN32_FILEIO
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Support Deflate compression */
#define ZIP_SUPPORT 1

View File

@ -32,7 +32,7 @@ if(WITH_TIFF AND NOT TIFF_FOUND)
set(TIFF_LIBRARY libtiff)
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libtiff")
set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}")
set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}" "${${TIFF_LIBRARY}_BINARY_DIR}")
endif()
################### libjpeg - optional