2010-05-11 19:44:00 +02:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# CMake file for libtiff. See root CMakeLists.txt
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
2012-02-24 14:53:22 +01:00
|
|
|
project(${TIFF_LIBRARY})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2012-03-01 10:01:32 +01:00
|
|
|
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)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2012-03-01 10:01:32 +01:00
|
|
|
if(WIN32)
|
|
|
|
set(USE_WIN32_FILEIO 1)
|
|
|
|
endif()
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2012-03-01 10:01:32 +01:00
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tif_config.h.cmakein"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h" @ONLY)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2012-03-03 16:49:23 +01:00
|
|
|
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" ${ZLIB_INCLUDE_DIR})
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
set(lib_srcs
|
2010-07-16 14:54:53 +02:00
|
|
|
tif_aux.c
|
|
|
|
tif_close.c
|
|
|
|
tif_codec.c
|
|
|
|
tif_color.c
|
|
|
|
tif_compress.c
|
|
|
|
tif_dir.c
|
|
|
|
tif_dirinfo.c
|
|
|
|
tif_dirread.c
|
|
|
|
tif_dirwrite.c
|
|
|
|
tif_dumpmode.c
|
|
|
|
tif_error.c
|
|
|
|
tif_extension.c
|
|
|
|
tif_fax3.c
|
|
|
|
tif_fax3sm.c
|
|
|
|
tif_flush.c
|
|
|
|
tif_getimage.c
|
|
|
|
tif_jbig.c
|
2012-03-01 10:01:32 +01:00
|
|
|
tif_jpeg_12.c
|
2010-07-16 14:54:53 +02:00
|
|
|
tif_jpeg.c
|
|
|
|
tif_luv.c
|
2012-03-01 10:01:32 +01:00
|
|
|
tif_lzma.c
|
2010-07-16 14:54:53 +02:00
|
|
|
tif_lzw.c
|
|
|
|
tif_next.c
|
|
|
|
tif_ojpeg.c
|
|
|
|
tif_open.c
|
|
|
|
tif_packbits.c
|
|
|
|
tif_pixarlog.c
|
|
|
|
tif_predict.c
|
|
|
|
tif_print.c
|
|
|
|
tif_read.c
|
|
|
|
tif_strip.c
|
|
|
|
tif_swab.c
|
|
|
|
tif_thunder.c
|
|
|
|
tif_tile.c
|
|
|
|
tif_version.c
|
|
|
|
tif_warning.c
|
|
|
|
tif_write.c
|
|
|
|
tif_zip.c
|
2012-03-01 10:01:32 +01:00
|
|
|
tif_stream.cxx
|
|
|
|
t4.h
|
|
|
|
tif_dir.h
|
|
|
|
tif_fax3.h
|
|
|
|
tiff.h
|
|
|
|
tiffio.h
|
|
|
|
tiffiop.h
|
|
|
|
tiffvers.h
|
|
|
|
tif_predict.h
|
2010-07-16 14:54:53 +02:00
|
|
|
uvcode.h
|
2012-03-01 10:01:32 +01:00
|
|
|
tiffio.hxx
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/tif_config.h"
|
2010-07-16 14:54:53 +02:00
|
|
|
)
|
2010-05-11 19:44:00 +02:00
|
|
|
|
|
|
|
if(UNIX)
|
2012-03-01 10:01:32 +01:00
|
|
|
list(APPEND lib_srcs tif_unix.c)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WIN32)
|
2012-03-01 10:01:32 +01:00
|
|
|
list(APPEND lib_srcs tif_win32.c)
|
2010-05-11 19:44:00 +02:00
|
|
|
endif(WIN32)
|
|
|
|
|
2012-06-20 14:27:02 +02:00
|
|
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
|
2012-06-12 16:46:12 +02:00
|
|
|
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
|
2012-08-28 09:29:40 +02:00
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter)
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd4706) # vs2005
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267 /wd4305 /wd4306) # vs2008 Win64
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4703) # vs2012
|
2010-05-11 19:44:00 +02:00
|
|
|
|
2012-10-23 13:04:38 +02:00
|
|
|
ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018)
|
|
|
|
|
2012-03-01 10:01:32 +01:00
|
|
|
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
2012-02-21 15:07:44 +01:00
|
|
|
endif()
|
|
|
|
|
2012-03-01 10:01:32 +01:00
|
|
|
add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})
|
2012-03-01 10:15:19 +01:00
|
|
|
target_link_libraries(${TIFF_LIBRARY} ${ZLIB_LIBRARIES})
|
|
|
|
|
2012-02-24 14:53:22 +01:00
|
|
|
set_target_properties(${TIFF_LIBRARY}
|
2012-06-08 05:15:08 +02:00
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "${TIFF_LIBRARY}"
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
2012-06-27 08:22:26 +02:00
|
|
|
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
2012-06-08 05:15:08 +02:00
|
|
|
)
|
|
|
|
|
2011-05-17 11:40:06 +02:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2012-02-24 14:53:22 +01:00
|
|
|
set_target_properties(${TIFF_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
2012-06-08 05:15:08 +02:00
|
|
|
endif()
|
2010-12-05 03:10:59 +01:00
|
|
|
|
|
|
|
if(NOT BUILD_SHARED_LIBS)
|
2012-06-27 08:22:26 +02:00
|
|
|
install(TARGETS ${TIFF_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
|
2010-12-05 03:10:59 +01:00
|
|
|
endif()
|