Skip to content

Commit

Permalink
[leptonica][tiff] Add LZMA to tiff's dependent libraries. Leptonica s…
Browse files Browse the repository at this point in the history
…hould use TIFF_LIBRARIES.
  • Loading branch information
ras0219-msft committed Nov 16, 2017
1 parent bb226b2 commit 24283ec
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/leptonica/CONTROL
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions ports/leptonica/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down
13 changes: 13 additions & 0 deletions ports/leptonica/use-tiff-libraries.patch
Original file line number Diff line number Diff line change
@@ -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})
10 changes: 10 additions & 0 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 24283ec

Please sign in to comment.