File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2614,6 +2614,12 @@ else() # macOS and Linux
26142614 target_include_directories (SerialPrograms PRIVATE ${HOMEBREW_PREFIX} /include /onnxruntime)
26152615 target_link_libraries (SerialPrograms PRIVATE ${HOMEBREW_PREFIX} /lib/libonnxruntime.dylib)
26162616 endif ()
2617+ # Find OpenCV
2618+ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)" )
2619+ find_package (OpenCV REQUIRED HINTS "/opt/homebrew/opt/opencv/lib/cmake/opencv4/" )
2620+ else ()
2621+ find_package (OpenCV REQUIRED HINTS "/usr/local/opt/opencv/lib/cmake/opencv4/" )
2622+ endif ()
26172623
26182624 else () # Linux
26192625 # Instructions took from https://github.com/microsoft/onnxruntime/discussions/6489
@@ -2646,13 +2652,10 @@ else() # macOS and Linux
26462652
26472653 # Link against ONNX Runtime
26482654 target_link_libraries (SerialPrograms PRIVATE onnxruntime)
2655+ # Find OpenCV
2656+ find_package (OpenCV REQUIRED HINTS "/usr/local/opt/opencv/lib/cmake/opencv4/" )
26492657 endif ()
26502658
2651- # Find OpenCV
2652- # set(OPENCV_DIR, "/usr/local/opt/opencv/lib/cmake/opencv4")
2653- find_package (OpenCV REQUIRED HINTS "/usr/local/opt/opencv/lib/cmake/opencv4/" )
2654- # set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/opencv/lib/pkgconfig")
2655- # pkg_search_module(OPENCV REQUIRED opencv)
26562659 include_directories (${OpenCV_INCLUDE_DIRS} )
26572660 link_directories (${OpenCV_LIBRARY_DIRS} )
26582661 target_link_libraries (SerialPrograms PRIVATE ${OpenCV_LIBS} )
You can’t perform that action at this time.
0 commit comments