Skip to content

Commit

Permalink
Python tools (#6067)
Browse files Browse the repository at this point in the history
* Removed useless lines

* Enable find PythonInterp only if we ENABLE_PYTHON

* Enable docs only if python interp is found
  • Loading branch information
ilya-lavrenov authored Jun 8, 2021
1 parent 98f45ff commit a99343f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 3 additions & 2 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Supported values:\

ie_option (ENABLE_PROFILING_FIRST_INFERENCE "Build with ITT tracing of first inference time." ON)

ie_option (ENABLE_DOCS "Build docs using Doxygen" OFF)

ie_option(ENABLE_TEMPLATE_PLUGIN "Register template plugin into plugins.xml" OFF)

ie_option_enum(SELECTIVE_BUILD "Enable OpenVINO conditional compilation or statistics collection. \
Expand All @@ -33,6 +31,9 @@ ie_option(ENABLE_ERROR_HIGHLIGHT "Highlight errors and warnings during compile t
find_package(PythonLibs 3 QUIET)
ie_dependent_option (ENABLE_PYTHON "enables ie python bridge build" OFF "PYTHONLIBS_FOUND" OFF)

find_package(PythonInterp 3 QUIET)
ie_dependent_option (ENABLE_DOCS "Build docs using Doxygen" OFF "PYTHONINTERP_FOUND" OFF)

#
# enable or disable output from NGRAPH_DEBUG statements
#
Expand Down
5 changes: 1 addition & 4 deletions openvino/conditional_compilation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ elseif(SELECTIVE_BUILD STREQUAL "ON")
message(FATAL_ERROR "In case SELECTIVE_BUILD is enabled, the SELECTIVE_BUILD_STAT variable should contain the path to the collected InelSEAPI statistics.\
Usage: -DSELECTIVE_BUILD=ON -DSELECTIVE_BUILD_STAT=/path/*.csv")
endif()
find_package (PythonInterp REQUIRED)
if(NOT PYTHON_VERSION_MAJOR EQUAL 3)
message(FATAL_ERROR " Python3 wasn't found!")
endif()
find_package (PythonInterp 3 REQUIRED)

file(GLOB STAT_FILES ${SELECTIVE_BUILD_STAT})

Expand Down
19 changes: 10 additions & 9 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.13)

project(python_tools)

if(NOT DEFINED OpenVINO_MAIN_SOURCE_DIR)
find_package(InferenceEngineDeveloperPackage QUIET)
endif()

find_package(PythonInterp 3 REQUIRED)
set(PYTHON_VERSION python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
if(ENABLE_PYTHON)
find_package(PythonInterp 3 REQUIRED)
set(PYTHON_VERSION python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})

set(TARGET_NAME "python_tools")
set(TARGET_NAME "python_tools")

if(WIN32)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python_api/${PYTHON_VERSION}/openvino)
else()
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python_api/${PYTHON_VERSION}/openvino)
endif()
if(WIN32)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python_api/${PYTHON_VERSION}/openvino)
else()
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python_api/${PYTHON_VERSION}/openvino)
endif()

if(ENABLE_PYTHON)
# creates a copy inside bin directory for developers to have ability running python benchmark_app
add_custom_target(${TARGET_NAME} ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_BRIDGE_OUTPUT_DIRECTORY}/tools
Expand Down

0 comments on commit a99343f

Please sign in to comment.