Skip to content

Commit

Permalink
Link zlib with OpenCV (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
umireon authored Aug 12, 2023
1 parent 01bdfe3 commit 58b2137
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmake/FetchOpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ FetchContent_MakeAvailable(opencv)

add_library(OpenCV INTERFACE)
if(MSVC)
target_link_libraries(OpenCV INTERFACE ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_imgproc480.lib
${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_core480.lib)
target_link_libraries(
OpenCV
INTERFACE ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_imgproc480.lib
${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_core480.lib
${opencv_SOURCE_DIR}/x64/vc17/staticlib/zlib.lib)
target_include_directories(OpenCV SYSTEM INTERFACE ${opencv_SOURCE_DIR}/include)
else()
target_link_libraries(OpenCV INTERFACE ${opencv_SOURCE_DIR}/lib/libopencv_imgproc.a
${opencv_SOURCE_DIR}/lib/libopencv_core.a)
target_link_libraries(
OpenCV INTERFACE ${opencv_SOURCE_DIR}/lib/libopencv_imgproc.a ${opencv_SOURCE_DIR}/lib/libopencv_core.a
${opencv_SOURCE_DIR}/lib/opencv4/3rdparty/libzlib.a)
target_include_directories(OpenCV SYSTEM INTERFACE ${opencv_SOURCE_DIR}/include/opencv4)
endif()

0 comments on commit 58b2137

Please sign in to comment.