File tree Expand file tree Collapse file tree 5 files changed +19
-9
lines changed
Expand file tree Collapse file tree 5 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 4040 sudo bash src/cpp/install_dependencies.sh
4141 - name : Build CPP Test
4242 run : |
43+ source venv/bin/activate
4344 pip install nanobind==2.4.0
4445 pip install typing_extensions==4.12.2
4546 mkdir build && cd build
Original file line number Diff line number Diff line change @@ -35,9 +35,10 @@ find_package(OpenCV REQUIRED COMPONENTS core imgproc)
3535
3636# Looking for OpenVINO in the python distribution. It doesn't work for cross-compiling build
3737if (NOT CMAKE_CROSSCOMPILING )
38- find_package (Python3 REQUIRED)
38+ set (Python_FIND_VIRTUALENV ONLY)
39+ find_package (Python COMPONENTS Interpreter Development REQUIRED)
3940 execute_process (
40- COMMAND ${Python3_EXECUTABLE } -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
41+ COMMAND ${Python_EXECUTABLE } -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
4142 OUTPUT_VARIABLE OpenVINO_DIR_PY
4243 ERROR_QUIET
4344 )
Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0
33#
44
5- set (DEV_MODULE Development.Module)
6-
7- find_package (Python COMPONENTS Interpreter ${DEV_MODULE} REQUIRED)
5+ set (Python_FIND_VIRTUALENV ONLY)
6+ find_package (Python COMPONENTS Interpreter Development REQUIRED)
87
98execute_process (
109 COMMAND "${Python_EXECUTABLE} " -m nanobind --cmake_dir
Original file line number Diff line number Diff line change @@ -64,7 +64,17 @@ FetchContent_MakeAvailable(json googletest)
6464include (../cmake/common.cmake)
6565
6666find_package (OpenCV REQUIRED COMPONENTS core highgui videoio imgproc imgcodecs)
67- find_package (OpenVINO REQUIRED COMPONENTS Runtime)
67+
68+ set (Python_FIND_VIRTUALENV ONLY)
69+ find_package (Python REQUIRED)
70+ execute_process (
71+ COMMAND ${Python_EXECUTABLE} -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
72+ OUTPUT_VARIABLE OpenVINO_DIR_PY
73+ ERROR_QUIET
74+ )
75+ find_package (OpenVINO REQUIRED
76+ COMPONENTS Runtime Threading
77+ HINTS "${OpenVINO_DIR_PY} " )
6878
6979add_subdirectory (../../../src/cpp ${tests_BINARY_DIR} /model_api/cpp)
7080
Original file line number Diff line number Diff line change @@ -35,13 +35,12 @@ macro(add_test)
3535 target_include_directories (${TEST_NAME} PRIVATE ${TEST_INCLUDE_DIRECTORIES} )
3636 endif ()
3737
38- target_link_libraries (${TEST_NAME} PRIVATE ${OpenCV_LIBRARIES} openvino::runtime ${TEST_DEPENDENCIES} )
38+ target_link_libraries (${TEST_NAME} PRIVATE ${OpenCV_LIBRARIES} ${TEST_DEPENDENCIES} )
3939
4040 if (UNIX )
4141 target_link_libraries (${TEST_NAME} PRIVATE pthread)
4242 endif ()
4343
44- target_link_libraries (${TEST_NAME} PRIVATE gtest gtest_main)
45- target_link_libraries (${TEST_NAME} PRIVATE nlohmann_json::nlohmann_json)
44+ target_link_libraries (${TEST_NAME} PRIVATE gtest_main gmock_main nlohmann_json::nlohmann_json)
4645
4746endmacro ()
You can’t perform that action at this time.
0 commit comments