2021-06-10 07:33:25 +08:00
|
|
|
set(LIBTIFF_VERSION 4.3.0)
|
2017-03-24 12:59:18 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2021-06-10 07:33:25 +08:00
|
|
|
URLS "https://download.osgeo.org/libtiff/tiff-${LIBTIFF_VERSION}.tar.gz"
|
2017-03-24 12:59:18 +08:00
|
|
|
FILENAME "tiff-${LIBTIFF_VERSION}.tar.gz"
|
2021-06-10 07:33:25 +08:00
|
|
|
SHA512 e04a4a6c542e58a174c1e9516af3908acf1d3d3e1096648c5514f4963f73e7af27387a76b0fbabe43cf867a18874088f963796a7cd6e45deb998692e3e235493
|
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
|
2021-06-10 07:33:25 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2018-09-12 04:11:51 +08:00
|
|
|
REF ${LIBTIFF_VERSION}
|
|
|
|
PATCHES
|
2019-05-29 07:58:00 +08:00
|
|
|
cmakelists.patch
|
2021-06-10 07:33:25 +08:00
|
|
|
fix-pkgconfig.patch
|
2021-07-23 13:10:42 +08:00
|
|
|
FindCMath.patch
|
2016-11-11 09:52:19 +08:00
|
|
|
)
|
|
|
|
|
2021-06-10 07:33:25 +08:00
|
|
|
set(EXTRA_OPTIONS "")
|
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
list(APPEND EXTRA_OPTIONS "-DUSE_WIN32_FILEIO=OFF") # On UWP we use the unix I/O api.
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if("cxx" IN_LIST FEATURES)
|
|
|
|
vcpkg_fail_port_install(
|
|
|
|
MESSAGE "Feature 'cxx' is not supported on ${VCPKG_TARGET_ARCHITECTURE}."
|
|
|
|
ON_ARCH arm arm64
|
|
|
|
)
|
2018-01-04 07:19:52 +08:00
|
|
|
endif()
|
|
|
|
|
2019-11-22 09:00:19 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-06-10 07:33:25 +08:00
|
|
|
FEATURES
|
|
|
|
cxx cxx
|
|
|
|
jpeg jpeg
|
|
|
|
lzma lzma
|
|
|
|
tools BUILD_TOOLS
|
|
|
|
webp webp
|
|
|
|
zip zlib
|
|
|
|
zstd zstd
|
2019-11-22 09:00:19 +08:00
|
|
|
)
|
|
|
|
|
2021-06-10 07:33:25 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2016-11-11 09:52:19 +08:00
|
|
|
OPTIONS
|
2019-11-22 09:00:19 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2021-06-10 07:33:25 +08:00
|
|
|
${EXTRA_OPTIONS}
|
2016-11-11 09:52:19 +08:00
|
|
|
-DBUILD_DOCS=OFF
|
|
|
|
-DBUILD_CONTRIB=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
2021-06-10 07:33:25 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=d # tiff sets "d" for MSVC only.
|
|
|
|
-Dlibdeflate=OFF
|
2017-03-24 05:33:22 +08:00
|
|
|
-Djbig=OFF # This is disabled by default due to GPL/Proprietary licensing.
|
|
|
|
-Djpeg12=OFF
|
2021-06-10 07:33:25 +08:00
|
|
|
-Dlerc=OFF
|
2019-08-13 05:42:45 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_OpenGL=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GLUT=ON
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2021-06-10 07:33:25 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-01-23 06:02:31 +08:00
|
|
|
|
|
|
|
set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libtiff-4.pc")
|
|
|
|
if(EXISTS "${_file}")
|
2021-06-10 07:33:25 +08:00
|
|
|
vcpkg_replace_string("${_file}" "-ltiff" "-ltiffd")
|
2021-01-23 06:02:31 +08:00
|
|
|
endif()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-06-10 07:33:25 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
file(REMOVE_RECURSE
|
2021-06-10 07:33:25 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share"
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
2016-11-03 07:25:40 +08:00
|
|
|
|
2021-06-10 07:33:25 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2021-06-10 07:33:25 +08:00
|
|
|
if ("tools" IN_LIST FEATURES)
|
|
|
|
set(_tools
|
|
|
|
fax2ps
|
|
|
|
fax2tiff
|
|
|
|
pal2rgb
|
|
|
|
ppm2tiff
|
|
|
|
raw2tiff
|
|
|
|
tiff2bw
|
|
|
|
tiff2pdf
|
|
|
|
tiff2ps
|
|
|
|
tiff2rgba
|
|
|
|
tiffcmp
|
|
|
|
tiffcp
|
|
|
|
tiffcrop
|
|
|
|
tiffdither
|
|
|
|
tiffdump
|
|
|
|
tiffinfo
|
|
|
|
tiffmedian
|
|
|
|
tiffset
|
|
|
|
tiffsplit
|
|
|
|
)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${_tools} AUTO_CLEAN)
|
|
|
|
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2019-11-22 09:00:19 +08:00
|
|
|
endif()
|
|
|
|
|
2019-05-29 07:58:00 +08:00
|
|
|
vcpkg_copy_pdbs()
|