From 58b21379951c26ac51ccf654de32b0489b087b86 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Sat, 12 Aug 2023 20:13:12 +0900 Subject: [PATCH] Link zlib with OpenCV (#422) --- cmake/FetchOpenCV.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/FetchOpenCV.cmake b/cmake/FetchOpenCV.cmake index 5b6c1cb0..3435ecb7 100644 --- a/cmake/FetchOpenCV.cmake +++ b/cmake/FetchOpenCV.cmake @@ -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()