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()