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")
|
2024-01-04 09:39:26 +08:00
|
|
|
include(SelectLibraryConfigurations)
|
2021-10-14 05:34:08 +08:00
|
|
|
set(z_vcpkg_tiff_link_libraries "")
|
|
|
|
set(z_vcpkg_tiff_libraries "")
|
2022-12-20 03:26:02 +08:00
|
|
|
if("@webp@")
|
2021-10-14 05:34:08 +08:00
|
|
|
find_package(WebP CONFIG ${z_vcpkg_tiff_find_options})
|
2024-02-27 16:16:01 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY:WebP::webp>")
|
2022-04-14 02:26:56 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${WebP_LIBRARIES})
|
2021-10-14 05:34:08 +08:00
|
|
|
endif()
|
2022-12-20 03:26:02 +08:00
|
|
|
if("@lzma@")
|
2022-03-01 02:25:31 +08:00
|
|
|
find_package(LibLZMA ${z_vcpkg_tiff_find_options})
|
2022-12-31 17:30:53 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY: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()
|
2022-12-20 03:26:02 +08:00
|
|
|
if("@jpeg@")
|
2021-10-14 05:34:08 +08:00
|
|
|
find_package(JPEG ${z_vcpkg_tiff_find_options})
|
2022-12-31 17:30:53 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY:JPEG::JPEG>")
|
2021-10-14 05:34:08 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${JPEG_LIBRARIES})
|
|
|
|
endif()
|
2022-12-20 03:26:02 +08:00
|
|
|
if("@zstd@")
|
2022-12-31 17:30:53 +08:00
|
|
|
find_package(zstd CONFIG ${z_vcpkg_tiff_find_options})
|
2023-01-17 04:45:42 +08:00
|
|
|
set(z_vcpkg_tiff_zstd_target_property "IMPORTED_LOCATION_")
|
2021-10-14 05:34:08 +08:00
|
|
|
if(TARGET zstd::libzstd_shared)
|
2022-12-31 17:30:53 +08:00
|
|
|
set(z_vcpkg_tiff_zstd "\$<LINK_ONLY:zstd::libzstd_shared>")
|
2023-01-17 04:45:42 +08:00
|
|
|
set(z_vcpkg_tiff_zstd_target zstd::libzstd_shared)
|
|
|
|
if(WIN32)
|
|
|
|
set(z_vcpkg_tiff_zstd_target_property "IMPORTED_IMPLIB_")
|
|
|
|
endif()
|
2021-10-14 05:34:08 +08:00
|
|
|
else()
|
2022-12-31 17:30:53 +08:00
|
|
|
set(z_vcpkg_tiff_zstd "\$<LINK_ONLY:zstd::libzstd_static>")
|
2023-01-17 04:45:42 +08:00
|
|
|
set(z_vcpkg_tiff_zstd_target zstd::libzstd_static)
|
|
|
|
endif()
|
|
|
|
get_target_property(z_vcpkg_tiff_zstd_configs "${z_vcpkg_tiff_zstd_target}" IMPORTED_CONFIGURATIONS)
|
|
|
|
foreach(z_vcpkg_config IN LISTS z_vcpkg_tiff_zstd_configs)
|
|
|
|
get_target_property(ZSTD_LIBRARY_${z_vcpkg_config} "${z_vcpkg_tiff_zstd_target}" "${z_vcpkg_tiff_zstd_target_property}${z_vcpkg_config}")
|
|
|
|
endforeach()
|
|
|
|
select_library_configurations(ZSTD)
|
|
|
|
if(NOT TARGET ZSTD::ZSTD)
|
|
|
|
add_library(ZSTD::ZSTD INTERFACE IMPORTED)
|
|
|
|
set_property(TARGET ZSTD::ZSTD APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_tiff_zstd})
|
2021-10-14 05:34:08 +08:00
|
|
|
endif()
|
2023-01-17 04:45:42 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries ${z_vcpkg_tiff_zstd})
|
2024-01-04 09:39:26 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${ZSTD_LIBRARIES})
|
2023-01-17 04:45:42 +08:00
|
|
|
unset(z_vcpkg_tiff_zstd)
|
|
|
|
unset(z_vcpkg_tiff_zstd_configs)
|
|
|
|
unset(z_vcpkg_config)
|
|
|
|
unset(z_vcpkg_tiff_zstd_target)
|
2021-10-14 05:34:08 +08:00
|
|
|
endif()
|
2024-02-09 14:41:50 +08:00
|
|
|
if("@lerc@")
|
|
|
|
find_package(unofficial-lerc ${z_vcpkg_tiff_find_options})
|
|
|
|
get_target_property(z_vcpkg_lerc_configs unofficial::Lerc::Lerc IMPORTED_CONFIGURATIONS)
|
|
|
|
foreach(z_vcpkg_property IN ITEMS IMPORTED_IMPLIB_ IMPORTED_LOCATION_)
|
|
|
|
foreach(z_vcpkg_config IN LISTS z_vcpkg_lerc_configs)
|
|
|
|
get_target_property(Z_VCPKG_LERC_LIBRARY_${z_vcpkg_config} unofficial::Lerc::Lerc "${z_vcpkg_property}${z_vcpkg_config}")
|
|
|
|
endforeach()
|
|
|
|
select_library_configurations(Z_VCPKG_LERC)
|
|
|
|
if(Z_VCPKG_LERC_LIBRARIES)
|
|
|
|
break()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY:unofficial::Lerc::Lerc>")
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${Z_VCPKG_LERC_LIBRARIES})
|
|
|
|
unset(z_vcpkg_config)
|
|
|
|
unset(z_vcpkg_lerc_configs)
|
|
|
|
unset(z_vcpkg_property)
|
|
|
|
unset(Z_VCPKG_LERC_FOUND)
|
|
|
|
endif()
|
2024-01-04 09:39:26 +08:00
|
|
|
if("@libdeflate@")
|
|
|
|
find_package(libdeflate ${z_vcpkg_tiff_find_options})
|
|
|
|
set(z_vcpkg_property "IMPORTED_LOCATION_")
|
|
|
|
if(TARGET libdeflate::libdeflate_shared)
|
|
|
|
set(z_vcpkg_libdeflate_target libdeflate::libdeflate_shared)
|
|
|
|
if(WIN32)
|
|
|
|
set(z_vcpkg_property "IMPORTED_IMPLIB_")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(z_vcpkg_libdeflate_target libdeflate::libdeflate_static)
|
|
|
|
endif()
|
|
|
|
get_target_property(z_vcpkg_libdeflate_configs "${z_vcpkg_libdeflate_target}" IMPORTED_CONFIGURATIONS)
|
|
|
|
foreach(z_vcpkg_config IN LISTS z_vcpkg_libdeflate_configs)
|
|
|
|
get_target_property(Z_VCPKG_DEFLATE_LIBRARY_${z_vcpkg_config} "${z_vcpkg_libdeflate_target}" "${z_vcpkg_property}${z_vcpkg_config}")
|
|
|
|
endforeach()
|
|
|
|
select_library_configurations(Z_VCPKG_DEFLATE)
|
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY:${z_vcpkg_libdeflate_target}>")
|
|
|
|
list(APPEND z_vcpkg_tiff_libraries ${Z_VCPKG_DEFLATE_LIBRARIES})
|
|
|
|
unset(z_vcpkg_config)
|
|
|
|
unset(z_vcpkg_libdeflate_configs)
|
|
|
|
unset(z_vcpkg_libdeflate_target)
|
|
|
|
unset(z_vcpkg_property)
|
|
|
|
unset(Z_VCPKG_DEFLATE_FOUND)
|
|
|
|
endif()
|
2022-12-20 03:26:02 +08:00
|
|
|
if("@zlib@")
|
2021-10-14 05:34:08 +08:00
|
|
|
find_package(ZLIB ${z_vcpkg_tiff_find_options})
|
2022-12-31 17:30:53 +08:00
|
|
|
list(APPEND z_vcpkg_tiff_link_libraries "\$<LINK_ONLY:ZLIB::ZLIB>")
|
2021-10-14 05:34:08 +08:00
|
|
|
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)
|