[leptonica][tiff] Add LZMA to tiff's dependent libraries. Leptonica should use TIFF_LIBRARIES.

This commit is contained in:
Robert Schumacher 2017-11-15 18:56:44 -08:00
parent bb226b2acc
commit 24283ec1ee
4 changed files with 28 additions and 1 deletions

View File

@ -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

View File

@ -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()
)

View File

@ -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})

View File

@ -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)