2021-10-14 05:34:08 +08:00
|
|
|
cmake_policy(PUSH)
|
|
|
|
cmake_policy(SET CMP0012 NEW)
|
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
set(z_vcpkg_tiff_find_options "")
|
|
|
|
if("REQUIRED" IN_LIST ARGS)
|
|
|
|
list(APPEND z_vcpkg_tiff_find_options "REQUIRED")
|
2021-06-10 07:33:25 +08:00
|
|
|
endif()
|
2021-10-14 05:34:08 +08:00
|
|
|
if("QUIET" IN_LIST ARGS)
|
|
|
|
list(APPEND z_vcpkg_tiff_find_options "QUIET")
|
2021-06-10 07:33:25 +08:00
|
|
|
endif()
|
2021-10-14 05:34:08 +08:00
|
|
|
|
|
|
|
_find_package(${ARGS})
|
|
|
|
|
|
|
|
if(TIFF_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static")
|
|
|
|
set(z_vcpkg_tiff_link_libraries "")
|
|
|
|
set(z_vcpkg_tiff_libraries "")
|
|
|
|
if(@webp@)
|
|
|
|
find_package(WebP CONFIG ${z_vcpkg_tiff_find_options})
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries WebP::WebP)
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${WEBP_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
if(@lzma@)
|
2022-03-01 02:25:31 +08:00
|
|
|
find_package(LibLZMA ${z_vcpkg_tiff_find_options})
|
2021-10-14 05:34:08 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries LibLZMA::LibLZMA)
|
2022-03-01 02:25:31 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${LIBLZMA_LIBRARIES})
|
2021-10-14 05:34:08 +08:00
|
|
|
endif()
|
|
|
|
if(@jpeg@)
|
|
|
|
find_package(JPEG ${z_vcpkg_tiff_find_options})
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries JPEG::JPEG)
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${JPEG_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
if(@zstd@)
|
|
|
|
find_package(ZSTD CONFIG ${z_vcpkg_tiff_find_options})
|
|
|
|
if(TARGET zstd::libzstd_shared)
|
|
|
|
set(z_vcpkg_tiff_zstd zstd::libzstd_shared)
|
|
|
|
else()
|
|
|
|
set(z_vcpkg_tiff_zstd zstd::libzstd_static)
|
|
|
|
endif()
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries ${z_vcpkg_tiff_zstd})
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${z_vcpkg_tiff_zstd})
|
|
|
|
endif()
|
|
|
|
if(@zlib@)
|
|
|
|
find_package(ZLIB ${z_vcpkg_tiff_find_options})
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries ZLIB::ZLIB)
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${ZLIB_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
if(UNIX)
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries m)
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries m)
|
2021-06-10 07:33:25 +08:00
|
|
|
endif()
|
|
|
|
|
2021-10-14 05:34:08 +08:00
|
|
|
if(TARGET TIFF::TIFF)
|
|
|
|
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_tiff_link_libraries})
|
|
|
|
endif()
|
|
|
|
list(APPEND TIFF_LIBRARIES ${z_vcpkg_tiff_libraries})
|
|
|
|
unset(z_vcpkg_tiff_link_libraries)
|
|
|
|
unset(z_vcpkg_tiff_libraries)
|
2021-06-10 07:33:25 +08:00
|
|
|
endif()
|
2021-10-14 05:34:08 +08:00
|
|
|
unset(z_vcpkg_tiff_find_options)
|
|
|
|
cmake_policy(POP)
|