-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: raise libtiff min to 4.0 + self-build for libtiff (and libdefl…
…ate) (#4296) Signed-off-by: Larry Gritz <[email protected]>
- Loading branch information
Showing
8 changed files
with
153 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
###################################################################### | ||
# TIFF by hand! | ||
###################################################################### | ||
|
||
set_cache (TIFF_BUILD_VERSION 4.6.0 "TIFF version for local builds") | ||
set (TIFF_GIT_REPOSITORY "https://gitlab.com/libtiff/libtiff.git") | ||
set (TIFF_GIT_TAG "v${TIFF_BUILD_VERSION}") | ||
set_cache (TIFF_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} | ||
DOC "Should a local TIFF build, if necessary, build shared libraries" ADVANCED) | ||
|
||
# We need libdeflate to build libtiff | ||
checked_find_package (libdeflate REQUIRED | ||
VERSION_MIN 1.18) | ||
alias_library_if_not_exists (Deflate::Deflate libdeflate::libdeflate_static) | ||
|
||
if (TARGET libjpeg-turbo::jpeg) | ||
# We've had some trouble with TIFF finding the JPEG resources it needs to | ||
# build if we're using libjpeg-turbo, TIFF needs an extra nudge. | ||
get_target_property(JPEG_INCLUDE_DIRS JPEG::JPEG INTERFACE_INCLUDE_DIRECTORIES) | ||
get_target_property(JPEG_LIBRARIES JPEG::JPEG INTERFACE_LINK_LIBRARIES) | ||
set (JPEG_FOUND TRUE) | ||
set (MORE_TIFF_CMAKE_ARGS | ||
-D JPEG_INCLUDE_DIR=${JPEG_INCLUDE_DIRS} | ||
-D JPEG_LIBRARY=${JPEG_LIBRARIES} ) | ||
endif () | ||
|
||
build_dependency_with_cmake(TIFF | ||
VERSION ${TIFF_BUILD_VERSION} | ||
GIT_REPOSITORY ${TIFF_GIT_REPOSITORY} | ||
GIT_TAG ${TIFF_GIT_TAG} | ||
CMAKE_ARGS | ||
-D BUILD_SHARED_LIBS=${TIFF_BUILD_SHARED_LIBS} | ||
-D CMAKE_POSITION_INDEPENDENT_CODE=ON | ||
-D CMAKE_INSTALL_LIBDIR=lib | ||
-D tiff-tools=OFF | ||
-D tiff-contrib=OFF | ||
-D tiff-tests=OFF | ||
-D tiff-docs=OFF | ||
-D libdeflate=ON | ||
-D lzma=OFF | ||
-D zstd=OFF | ||
-D jbig=OFF | ||
${MORE_TIFF_CMAKE_ARGS} | ||
) | ||
|
||
# Set some things up that we'll need for a subsequent find_package to work | ||
|
||
set (TIFF_ROOT ${TIFF_LOCAL_INSTALL_DIR}) | ||
set (TIFF_DIR ${TIFF_LOCAL_INSTALL_DIR}) | ||
|
||
# Signal to caller that we need to find again at the installed location | ||
# set (TIFF_REFIND TRUE) | ||
find_package (TIFF REQUIRED) | ||
|
||
if (TIFF_BUILD_SHARED_LIBS) | ||
install_local_dependency_libs (TIFF TIFF) | ||
endif () | ||
|
||
unset (MORE_TIFF_CMAKE_ARGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright Contributors to the OpenImageIO project. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# https://github.com/AcademySoftwareFoundation/OpenImageIO | ||
|
||
###################################################################### | ||
# libdeflate by hand! | ||
###################################################################### | ||
|
||
set_cache (libdeflate_BUILD_VERSION 1.20 "libdeflate version for local builds") | ||
set (libdeflate_GIT_REPOSITORY "https://github.com/ebiggers/libdeflate") | ||
set (libdeflate_GIT_TAG "v${libdeflate_BUILD_VERSION}") | ||
set_cache (libdeflate_BUILD_SHARED_LIBS ${LOCAL_BUILD_SHARED_LIBS_DEFAULT} | ||
DOC "Should a local libdeflate build, if necessary, build shared libraries" ADVANCED) | ||
|
||
string (MAKE_C_IDENTIFIER ${libdeflate_BUILD_VERSION} libdeflate_VERSION_IDENT) | ||
|
||
build_dependency_with_cmake(libdeflate | ||
VERSION ${libdeflate_BUILD_VERSION} | ||
GIT_REPOSITORY ${libdeflate_GIT_REPOSITORY} | ||
GIT_TAG ${libdeflate_GIT_TAG} | ||
CMAKE_ARGS | ||
-D BUILD_SHARED_LIBS=${libdeflate_BUILD_SHARED_LIBS} | ||
-D CMAKE_POSITION_INDEPENDENT_CODE=ON | ||
-D CMAKE_INSTALL_LIBDIR=lib | ||
-D LIBDEFLATE_BUILD_GZIP=OFF | ||
) | ||
|
||
# Set some things up that we'll need for a subsequent find_package to work | ||
|
||
set (libdeflate_ROOT ${libdeflate_LOCAL_INSTALL_DIR}) | ||
|
||
# Signal to caller that we need to find again at the installed location | ||
set (libdeflate_REFIND TRUE) | ||
set (libdeflate_REFIND_ARGS CONFIG) | ||
|
||
if (libdeflate_BUILD_SHARED_LIBS) | ||
install_local_dependency_libs (libdeflate libdeflate) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters