2020-08-08 02:49:27 +08:00
|
|
|
set(LIBTIFF_VERSION 4.1.0)
|
2017-03-24 12:59:18 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-03-24 12:59:18 +08:00
|
|
|
URLS "http://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz"
|
|
|
|
FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz"
|
2020-08-08 02:49:27 +08:00
|
|
|
SHA512 fd541dcb11e3d5afaa1ec2f073c9497099727a52f626b338ef87dc93ca2e23ca5f47634015a4beac616d4e8f05acf7b7cd5797fb218758cc2ad31b390491c5a6
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
2019-05-29 07:58:00 +08:00
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${LIBTIFF_VERSION}
|
|
|
|
PATCHES
|
2019-01-22 16:32:52 +08:00
|
|
|
fix-stddef.patch
|
2019-05-29 07:58:00 +08:00
|
|
|
cmakelists.patch
|
2016-11-11 09:52:19 +08:00
|
|
|
)
|
|
|
|
|
2018-01-04 07:19:52 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
|
|
|
set (TIFF_CXX_TARGET -Dcxx=OFF)
|
|
|
|
endif()
|
|
|
|
|
2019-11-22 09:00:19 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
tool BUILD_TOOLS
|
2021-04-20 08:19:07 +08:00
|
|
|
zstd WITH_ZSTD
|
2019-11-22 09:00:19 +08:00
|
|
|
)
|
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
2016-09-29 08:05:56 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-03-24 05:33:22 +08:00
|
|
|
PREFER_NINJA
|
2016-11-11 09:52:19 +08:00
|
|
|
OPTIONS
|
2019-11-22 09:00:19 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2016-11-11 09:52:19 +08:00
|
|
|
-DBUILD_DOCS=OFF
|
|
|
|
-DBUILD_CONTRIB=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
2017-03-24 05:33:22 +08:00
|
|
|
-Djbig=OFF # This is disabled by default due to GPL/Proprietary licensing.
|
|
|
|
-Djpeg12=OFF
|
[tiff] Disable libwebp support. (#5348)
* [tiff]: disable libwebp support.
Since version 4.0.10, libtiff supports optional compression modes using
either libweb or zstd.
When libtiff is built, and libwebp and/or zstd are found anywhere on the
system, these modes will be enabled. However, the respective libraries
are not added as link targets, so this will result in linker errors for
any unsuspecting project using libtiff.
Since zstd support was already disabled by a previous commit, I have
also simply disabled libwebp support to fix this issue.
A more proper fix might be to add both libwebp and zstd as required
libtiff dependencies, and to patch libtiff's CMakeLists.txt, such that
these libraries are properly linked to. However, it is currently very
unlikely to encounter TIFF images in the wild compressed using either
of these methods, so the effect of disabling support may not be
noticeable at all.
* [tiff] Change CONTROL version
2019-02-15 02:22:04 +08:00
|
|
|
-Dwebp=OFF
|
2021-04-20 08:19:07 +08:00
|
|
|
-Dzstd=${WITH_ZSTD}
|
2019-08-13 05:42:45 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_OpenGL=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GLUT=ON
|
2018-01-04 07:19:52 +08:00
|
|
|
${TIFF_CXX_TARGET}
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2021-01-23 06:02:31 +08:00
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libtiff-4.pc")
|
|
|
|
if(EXISTS "${_file}")
|
|
|
|
vcpkg_replace_string("${_file}" "-ltiff" "-ltiffd")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Fix dependencies:
|
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libtiff-4.pc")
|
|
|
|
if(EXISTS "${_file}")
|
|
|
|
vcpkg_replace_string("${_file}" "Version: 4.1.0" "Version: 4.1.0\nRequires.private: liblzma libjpeg")
|
|
|
|
endif()
|
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libtiff-4.pc")
|
|
|
|
if(EXISTS "${_file}")
|
|
|
|
vcpkg_replace_string("${_file}" "Version: 4.1.0" "Version: 4.1.0\nRequires.private: liblzma libjpeg")
|
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2021-01-23 06:02:31 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2016-09-19 11:50:08 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/share
|
|
|
|
${CURRENT_PACKAGES_DIR}/share
|
|
|
|
)
|
2016-11-03 07:25:40 +08:00
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2020-08-08 02:49:27 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2019-05-29 07:58:00 +08:00
|
|
|
|
2019-11-22 09:00:19 +08:00
|
|
|
if ("tool" IN_LIST FEATURES)
|
|
|
|
file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
|
|
|
|
file(INSTALL ${TIFF_TOOLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
2020-05-16 08:04:10 +08:00
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
2019-11-22 09:00:19 +08:00
|
|
|
file(REMOVE ${TIFF_TOOLS})
|
|
|
|
file(GLOB TIFF_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
|
|
|
|
file(REMOVE ${TIFF_TOOLS})
|
2020-05-16 08:04:10 +08:00
|
|
|
|
2019-11-22 09:00:19 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-05-29 07:58:00 +08:00
|
|
|
vcpkg_copy_pdbs()
|