Skip to content

Commit

Permalink
[tiff] use proper liblzma target
Browse files Browse the repository at this point in the history
[OpenCV] add an explicit dependency on LibLZMA for static linking
  • Loading branch information
cenit committed Apr 8, 2019
1 parent 4f41d54 commit d845870
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/opencv/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: opencv
Version: 3.4.3-7
Version: 3.4.3-8
Build-Depends: zlib
Description: computer vision library
Default-Features: opengl, jpeg, png, tiff, eigen, flann
Expand Down
8 changes: 8 additions & 0 deletions ports/opencv/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,14 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}"
"\${_VCPKG_INSTALLED_DIR}/\${VCPKG_TARGET_TRIPLET}" OPENCV_MODULES "${OPENCV_MODULES}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(READ ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake OPENCV_MODULES)
string(REPLACE "set(CMAKE_IMPORT_FILE_VERSION 1)"
"set(CMAKE_IMPORT_FILE_VERSION 1)
find_package(TIFF REQUIRED)" OPENCV_MODULES "${OPENCV_MODULES}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/opencv/OpenCVModules.cmake "${OPENCV_MODULES}")
endif()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

Expand Down
4 changes: 2 additions & 2 deletions ports/tiff/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ find_package(LibLZMA CONFIG)
find_package(JPEG)
find_package(ZLIB)
if(TARGET TIFF::TIFF)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES} JPEG::JPEG ZLIB::ZLIB)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES LZMA::LZMA JPEG::JPEG ZLIB::ZLIB)
if(UNIX)
set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES m)
endif()
endif()
if(TIFF_LIBRARIES)
list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES})
list(APPEND TIFF_LIBRARIES LZMA::LZMA ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES})
if(UNIX)
list(APPEND TIFF_LIBRARIES m)
endif()
Expand Down

0 comments on commit d845870

Please sign in to comment.