aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-15 18:56:44 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-15 18:57:05 -0800
commit24283ec1ee019df3e43dbb9c9bf2f1d9d1263911 (patch)
tree87864ee4d525c877e5acc0c7b32c26d01e2e644b
parentbb226b2accbb9b9fbb6e1ffc45875ff6ba7663df (diff)
downloadvcpkg-24283ec1ee019df3e43dbb9c9bf2f1d9d1263911.tar.gz
vcpkg-24283ec1ee019df3e43dbb9c9bf2f1d9d1263911.zip
[leptonica][tiff] Add LZMA to tiff's dependent libraries. Leptonica should use TIFF_LIBRARIES.
-rw-r--r--ports/leptonica/CONTROL2
-rw-r--r--ports/leptonica/portfile.cmake4
-rw-r--r--ports/leptonica/use-tiff-libraries.patch13
-rw-r--r--scripts/buildsystems/vcpkg.cmake10
4 files changed, 28 insertions, 1 deletions
diff --git a/ports/leptonica/CONTROL b/ports/leptonica/CONTROL
index cd1c44cb4..6ca0bea56 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 a5d4330fd..acaf7fe9d 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 000000000..f994be552
--- /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 e3aa46b64..66dd50169 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)