--- a/cmake/DeflateCodec.cmake +++ b/cmake/DeflateCodec.cmake @@ -35,7 +35,10 @@ set(LIBDEFLATE_SUPPORT FALSE) # libdeflate set(LIBDEFLATE_SUPPORT FALSE) -find_package(Deflate) +find_package(libdeflate CONFIG) +if(libdeflate_FOUND) + set(Deflate_FOUND TRUE) +endif() option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND}) if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT) set(LIBDEFLATE_SUPPORT TRUE) --- a/cmake/JBIGCodec.cmake +++ b/cmake/JBIGCodec.cmake @@ -27,14 +27,17 @@ set(JBIG_SUPPORT FALSE) # JBIG-KIT set(JBIG_SUPPORT FALSE) -find_package(JBIG) +find_package(jbig CONFIG) +if(jbig_FOUND) + set(JBIG_FOUND TRUE) +endif() if(JBIG_FOUND) set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES}) - check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN) + set(HAVE_JBG_NEWLEN TRUE) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) endif() --- a/cmake/JPEGCodec.cmake +++ b/cmake/JPEGCodec.cmake @@ -47,19 +47,7 @@ cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES "${JPEG_INCLUDE_DIRS}") set(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARIES}") - check_c_source_compiles( - " - #include - #include - #include \"jpeglib.h\" - int main() - { - jpeg_read_scanlines(0,0,0); - jpeg12_read_scanlines(0,0,0); - return 0; - } - " - HAVE_JPEGTURBO_DUAL_MODE_8_12) + set(HAVE_JPEGTURBO_DUAL_MODE_8_12 FALSE) cmake_pop_check_state() endif() --- a/cmake/ZSTDCodec.cmake +++ b/cmake/ZSTDCodec.cmake @@ -28,7 +28,10 @@ set(ZSTD_USABLE FALSE) set(ZSTD_SUPPORT FALSE) set(ZSTD_USABLE FALSE) -find_package(ZSTD) +find_package(zstd CONFIG) +if(zstd_FOUND) + set(ZSTD_FOUND TRUE) +endif() if(ZSTD_FOUND) if(NOT DEFINED ZSTD_HAVE_DECOMPRESS_STREAM) @@ -36,7 +39,7 @@ if(ZSTD_FOUND) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS}) set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES}) - check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_HAVE_DECOMPRESS_STREAM) + set(ZSTD_HAVE_DECOMPRESS_STREAM TRUE) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE}) endif() --- a/libtiff/CMakeLists.txt +++ b/libtiff/CMakeLists.txt @@ -116,7 +116,7 @@ if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) string(APPEND tiff_requires_private " zlib") endif() if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT) - target_link_libraries(tiff PRIVATE Deflate::Deflate) + target_link_libraries(tiff PRIVATE $,libdeflate::libdeflate,libdeflate::libdeflate_static>) list(APPEND tiff_libs_private_list "${Deflate_LIBRARY}") endif() if(JPEG_SUPPORT) @@ -130,7 +130,7 @@ if(JBIG_SUPPORT) endif() endif() if(JBIG_SUPPORT) - target_link_libraries(tiff PRIVATE JBIG::JBIG) + target_link_libraries(tiff PRIVATE jbig::jbig) list(APPEND tiff_libs_private_list "${JBIG_LIBRARY}") endif() if(LERC_SUPPORT) @@ -145,11 +145,11 @@ if(ZSTD_SUPPORT) string(APPEND tiff_requires_private " liblzma") endif() if(ZSTD_SUPPORT) - target_link_libraries(tiff PRIVATE ZSTD::ZSTD) + target_link_libraries(tiff PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) string(APPEND tiff_requires_private " libzstd") endif() if(WEBP_SUPPORT) - target_link_libraries(tiff PRIVATE WebP::WebP) + target_link_libraries(tiff PRIVATE WebP::webp) string(APPEND tiff_requires_private " libwebp") endif() if(CMath_LIBRARY)