diff --git a/ports/leptonica/CONTROL b/ports/leptonica/CONTROL index cd1c44cb46c..6ca0bea56f1 100644 --- a/ports/leptonica/CONTROL +++ b/ports/leptonica/CONTROL @@ -1,4 +1,4 @@ Source: leptonica -Version: 1.74.4-1 +Version: 1.74.4-2 Description: An open source library containing software that is broadly useful for image processing and image analysis applications Build-Depends: libjpeg-turbo, zlib, libpng, tiff, giflib diff --git a/ports/leptonica/portfile.cmake b/ports/leptonica/portfile.cmake index a5d4330fd84..acaf7fe9d01 100644 --- a/ports/leptonica/portfile.cmake +++ b/ports/leptonica/portfile.cmake @@ -12,12 +12,16 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch + ${CMAKE_CURRENT_LIST_DIR}/use-tiff-libraries.patch ) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS + -DSTATIC=${STATIC} -DCMAKE_REQUIRED_INCLUDES=${CURRENT_INSTALLED_DIR}/include # for check_include_file() ) diff --git a/ports/leptonica/use-tiff-libraries.patch b/ports/leptonica/use-tiff-libraries.patch new file mode 100644 index 00000000000..f994be55287 --- /dev/null +++ b/ports/leptonica/use-tiff-libraries.patch @@ -0,0 +1,13 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3af7e30..55e17da 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -44,7 +44,7 @@ if (PNG_LIBRARY) + endif() + if (TIFF_LIBRARY) + target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR}) +- target_link_libraries (leptonica ${TIFF_LIBRARY}) ++ target_link_libraries (leptonica ${TIFF_LIBRARIES}) + endif() + if (WEBP_FOUND) + target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIR}) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index e3aa46b64de..66dd50169a1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -159,6 +159,16 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) endif() _find_package(${ARGV}) + + if("${name}" STREQUAL "TIFF") + find_package(LibLZMA) + if(TARGET TIFF::TIFF) + set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + if(TIFF_LIBRARIES) + list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + endif() endmacro() set(VCPKG_TOOLCHAIN ON)