Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtiff: update to 4.7.0 #4961

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,37 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(FALSE) # XXX(ITK): ITK handles CMake versions.
cmake_minimum_required(VERSION 3.9.0)

# Default policy is from 3.9.0
cmake_policy(VERSION 3.9.0)
endif()

# Find CMake modules in cmake/
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

if(FALSE) # XXX(ITK): We hard-code the TIFF version that we imported.
# Read version information from configure.ac.
include(AutotoolsVersion)
message(STATUS "Building tiff version ${LIBTIFF_VERSION_FULL}")
else()
# Hard-code the version of TIFF used by ITK.
set(LIBTIFF_MAJOR_VERSION 4)
set(LIBTIFF_MINOR_VERSION 7)
set(LIBTIFF_MICRO_VERSION 0)
set(LIBTIFF_ALPHA_VERSION)
set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}")
set(LIBTIFF_VERSION_FULL "${LIBTIFF_VERSION}${LIBTIFF_ALPHA_VERSION}")
endif()

# Project definition
set(CMAKE_C_STANDARD 99)
project(tiff
VERSION "${LIBTIFF_VERSION}"
LANGUAGES C CXX)

if(FALSE) # XXX(ITK): Suppress options not relevant to ITK.
if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# libtiff is being included as a subproject of some other project.
set(TIFF_INSTALL_DEFAULT OFF)
Expand All @@ -56,6 +69,10 @@ option(tiff-contrib "build TIFF contrib" ON)
option(tiff-docs "build TIFF documentation" ON)
option(tiff-deprecated "build TIFF deprecated features" OFF)
option(tiff-install "install TIFF targets" ${TIFF_INSTALL_DEFAULT})
else()
set(tiff-deprecated ON)
set(tiff-install OFF)
endif()

# Disable deprecated features to ensure clean build
if (tiff-deprecated)
Expand Down Expand Up @@ -85,8 +102,10 @@ include(GNUInstallDirs)
# Documentation install directory (default to cmake project docdir)
set(LIBTIFF_DOCDIR "${CMAKE_INSTALL_DOCDIR}")

if(FALSE) # XXX(ITK): ITK handles testing
# CTest testing
enable_testing()
endif()

# Checks for type presence and size
include(TypeSizeChecks)
Expand Down Expand Up @@ -137,12 +156,15 @@ include(LibraryFeatures)
# math.h/libm portability
find_package(CMath REQUIRED)

if(FALSE) # XXX(ITK): We do not create TIFF releases.
# Release support
include(Release)
endif()

# Process subdirectories
add_subdirectory(port)
add_subdirectory(libtiff)
return() # XXX(ITK): We do not need TIFF project infrastructure.
if(tiff-tools)
add_subdirectory(tools)
endif()
Expand Down
4 changes: 4 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/CXXLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(cxx 0)
endif()

# C++ support
option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
set(CXX_SUPPORT FALSE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

return() # XXX(ITK): We do not need TIFF project infrastructure.

include(CheckCCompilerFlag)

Expand Down
6 changes: 6 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/DeflateCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(ZLIB_SUPPORT TRUE)
set(ZIP_SUPPORT TRUE)
set(LIBDEFLATE_SUPPORT FALSE)
return()
endif()

# ZLIB
set(ZLIB_SUPPORT FALSE)
Expand Down
3 changes: 2 additions & 1 deletion Modules/ThirdParty/TIFF/src/itktiff/cmake/FindCMath.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ include(CheckSymbolExists)
include(CheckLibraryExists)

check_symbol_exists(pow "math.h" CMath_HAVE_LIBC_POW)
find_library(CMath_LIBRARY NAMES m)

if(NOT CMath_HAVE_LIBC_POW)
find_library(CMath_LIBRARY NAMES m)
mark_as_advanced(CMath_LIBRARY)
set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMath_LIBRARY})
check_symbol_exists(pow "math.h" CMath_HAVE_LIBM_POW)
Expand Down
10 changes: 10 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/InternalCodecs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(ccitt ON)
set(packbits ON)
set(lzw ON)
set(lze ON)
set(thunder ON)
set(next ON)
set(logluv ON)
set(mdi ON)
endif()
bradking marked this conversation as resolved.
Show resolved Hide resolved

option(ccitt "support for CCITT Group 3 & 4 algorithms" ON)
set(CCITT_SUPPORT ${ccitt})
Expand Down
2 changes: 1 addition & 1 deletion Modules/ThirdParty/TIFF/src/itktiff/cmake/JBIGCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.


# JBIG-KIT
set(JBIG_SUPPORT FALSE)
return() # XXX(ITK): hard-code settings

find_package(JBIG)

Expand Down
5 changes: 5 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/JPEGCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(JPEG_SUPPORT TRUE)
set(OJPEG_SUPPORT FALSE)
return()
endif()

# JPEG
set(JPEG_SUPPORT FALSE)
Expand Down
1 change: 1 addition & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/LERCCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# libLerc
set(LERC_SUPPORT FALSE)
return() # XXX(ITK): hard-code settings
find_package(LERC)
option(lerc "use libLerc (required for LERC compression)" ${LERC_FOUND})
if (lerc AND LERC_FOUND AND ZIP_SUPPORT)
Expand Down
1 change: 1 addition & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/LZMACodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

# liblzma2
set(LZMA_SUPPORT FALSE)
return() # XXX(ITK): hard-code settings
find_package(liblzma)

option(lzma "use liblzma (required for LZMA2 compression)" ${LIBLZMA_FOUND})
Expand Down
10 changes: 10 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/LibraryFeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(strip-chopping 1)
set(defer-strile-load 0)
set(chunky-strip-read 0)
set(extrasample-as-alpha 0)
set(check-ycbcr-subsampling 0)
endif()

# Strip chopping
option(strip-chopping "strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)" ON)
set(TIFF_DEFAULT_STRIP_SIZE 8192 CACHE STRING "default size of the strip in bytes (when strip chopping is enabled)")
mark_as_advanced(TIFF_DEFAULT_STRIP_SIZE) # XXX(ITK)

set(STRIPCHOP_DEFAULT)
if(strip-chopping)
Expand All @@ -36,6 +45,7 @@ if(strip-chopping)
endif()

set(TIFF_MAX_DIR_COUNT 1048576 CACHE STRING "Maximum number of TIFF directories that libtiff can browse through")
mark_as_advanced(TIFF_MAX_DIR_COUNT) # XXX(ITK)

# Defer loading of strip/tile offsets
option(defer-strile-load "enable deferred strip/tile offset/size loading (also available at runtime with the 'D' flag of TIFFOpen())" OFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

return() # XXX(ITK): We do not need TIFF project infrastructure.

include(CheckCSourceCompiles)

Expand Down
5 changes: 5 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/OpenGLChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(OPENGL_SUPPORT FALSE)
return()
endif()

# OpenGL and GLUT
set(OpenGL_GL_PREFERENCE LEGACY)

Expand Down
3 changes: 3 additions & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/PixarLogCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
set(pixarlog 1)
endif()

# Option for Pixar log-format algorithm
# Pixar log format
Expand Down
1 change: 1 addition & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/cmake/WebPCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# libwebp
set(WEBP_SUPPORT FALSE)
return() # XXX(ITK): hard-code settings

find_package(WebP)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.

if(TRUE) # XXX(ITK): hard-code settings
if(WIN32)
set(USE_WIN32_FILEIO ON)
else()
set(USE_WIN32_FILEIO OFF)
endif()
return()
endif()

if(MSVC)
# Debug postfix
set(CMAKE_DEBUG_POSTFIX "d")
Expand Down
3 changes: 2 additions & 1 deletion Modules/ThirdParty/TIFF/src/itktiff/cmake/ZSTDCodec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.


# libzstd
set(ZSTD_SUPPORT FALSE)
set(ZSTD_USABLE FALSE)

return() # XXX(ITK): hard-code settings

find_package(ZSTD)

if(ZSTD_FOUND)
Expand Down
Loading