vcpkg/ports/tesseract/fix-depend-libarchive.patch
Russell Greene 455d8d85e0
[tesseract] Link executable to libarchive to fix linker error ()
* [tesseract] link exe to libarchive to fix link error

* ./vcpkg x-add-version --all

* address comments

* ./vcpkg x-add-version --all --overwrite-version
2022-10-24 14:12:32 -07:00

24 lines
856 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd2649d..c1801a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -792,7 +792,8 @@ if(OpenCL_FOUND)
target_link_libraries(libtesseract PUBLIC OpenCL::OpenCL)
endif()
if(LibArchive_FOUND)
- target_link_libraries(libtesseract PUBLIC ${LibArchive_LIBRARIES})
+ find_package(LibArchive REQUIRED)
+ target_link_libraries(libtesseract PRIVATE LibArchive::LibArchive)
endif(LibArchive_FOUND)
if(CURL_FOUND)
if(NOT CURL_LIBRARIES)
@@ -854,7 +855,7 @@ endif()
# ##############################################################################
add_executable(tesseract src/tesseract.cpp)
-target_link_libraries(tesseract libtesseract)
+target_link_libraries(tesseract libtesseract LibArchive::LibArchive)
if(HAVE_TIFFIO_H AND WIN32)
target_link_libraries(tesseract ${TIFF_LIBRARIES})
endif()