diff --git a/cmake/features.cmake b/cmake/features.cmake index fe1b8919b51212..adb1fad25238da 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -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. \ @@ -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 # diff --git a/openvino/conditional_compilation/CMakeLists.txt b/openvino/conditional_compilation/CMakeLists.txt index 4a27ac50b7cb84..1db12d4eefbd0a 100644 --- a/openvino/conditional_compilation/CMakeLists.txt +++ b/openvino/conditional_compilation/CMakeLists.txt @@ -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}) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 0a09df95faa8bc..fdc6d9ef11a8f4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -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}/$/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}/$/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