Skip to content

Commit dd47671

Browse files
committed
2 parents f15e343 + 4b1436c commit dd47671

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/cpp-ci-serial-programs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install dependencies
3737
if: startsWith(matrix.os, 'mac')
3838
run: |
39-
brew install opencv
39+
brew install opencv onnxruntime
4040
- uses: jurplel/install-qt-action@v4
4141
with:
4242
version: ${{ matrix.qt_version }}

SerialPrograms/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,12 +2399,17 @@ if (MSVC)
23992399
# target_compile_options(SerialPrograms PRIVATE /arch:AVX512 /DPA_Arch_x64_AVX512)
24002400
# target_compile_options(SerialPrograms PRIVATE /arch:AVX512 /DPA_Arch_x64_AVX512GF)
24012401
else()
2402-
# Find ONNX Runtime
2403-
target_include_directories(SerialPrograms PRIVATE /opt/homebrew/include/onnxruntime)
2404-
target_link_libraries(SerialPrograms PRIVATE /opt/homebrew/lib/libonnxruntime.dylib)
2402+
# Get root path where Homebrew installs libraries. Example root path: "/opt/homebrew/",
2403+
# where you can find libraries in "/opt/homebrew/lib/" and headers in "/opt/homebrew/include/".
2404+
# CMake does not support ONNX Runtime, so we have to add ONNX Runtime paths on our own.
2405+
# Save the root path as CMake variable HOMEBREW_PREFIX.
2406+
execute_process(COMMAND brew --prefix OUTPUT_VARIABLE HOMEBREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
24052407

2406-
# Find OpenCV
2408+
# Get ONNX Runtime paths
2409+
target_include_directories(SerialPrograms PRIVATE ${HOMEBREW_PREFIX}/include/onnxruntime)
2410+
target_link_libraries(SerialPrograms PRIVATE ${HOMEBREW_PREFIX}/lib/libonnxruntime.dylib)
24072411

2412+
# Find OpenCV
24082413
# set(OPENCV_DIR, "/usr/local/opt/opencv/lib/cmake/opencv4")
24092414
find_package(OpenCV REQUIRED HINTS "/usr/local/opt/opencv/lib/cmake/opencv4/")
24102415
# set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/opencv/lib/pkgconfig")

0 commit comments

Comments
 (0)