Skip to content

Commit 7725514

Browse files
1 parent 91dc0ce commit 7725514

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CMakeLists.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ endif()
4141

4242
# Looking for OpenVINO in the python distribution. It doesn't work for cross-compiling build
4343
if(NOT CMAKE_CROSSCOMPILING)
44-
find_package(Python3 REQUIRED)
45-
execute_process(
46-
COMMAND ${Python3_EXECUTABLE} -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
47-
OUTPUT_VARIABLE OpenVINO_DIR_PY
48-
ERROR_QUIET
49-
)
44+
find_package(Python3 QUIET COMPONENTS Interpreter)
45+
if(Python3_Interpreter_FOUND)
46+
execute_process(
47+
COMMAND ${Python3_EXECUTABLE} -c "from openvino.utils import get_cmake_path; print(get_cmake_path(), end='')"
48+
OUTPUT_VARIABLE OpenVINO_DIR_PY
49+
ERROR_QUIET
50+
)
51+
endif()
5052
endif()
5153

5254
# Find OpenVINODeveloperPackage first to compile with SDL flags

0 commit comments

Comments
 (0)