diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 1b61b065a4925b..5e07092e692ff4 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -16,14 +16,6 @@ if(NOT DEFINED OpenVINO_SOURCE_DIR) set(OpenVINO_BINARY_DIR "${OpenVINODeveloperPackage_DIR}") endif() -if(DEFINED ENV{CI_BUILD_DEV_TAG} AND NOT "$ENV{CI_BUILD_DEV_TAG}" STREQUAL "") - set(WHEEL_VERSION "${OpenVINO_VERSION}.$ENV{CI_BUILD_DEV_TAG}" CACHE STRING "Version of this release" FORCE) - set(wheel_pre_release ON) -else() - set(WHEEL_VERSION ${OpenVINO_VERSION} CACHE STRING "Version of this release" FORCE) -endif() -set(WHEEL_BUILD "${OpenVINO_VERSION_BUILD}" CACHE STRING "Build number of this release" FORCE) - # # Check python requirements # @@ -148,6 +140,11 @@ if(LINUX) endif() endif() +if(CMAKE_VERSION VERSION_LESS 3.15) + message(${message_mode} "Cmake version 3.15 and higher is required. Provided version ${CMAKE_VERSION}") + set(ENABLE_WHEEL_DEFAULT OFF) +endif() + # this option should not be a part of OpenVINODeveloperPackage # since wheels can be built only together with main OV build ie_dependent_option(ENABLE_WHEEL "Build wheel packages for PyPI" ${ENABLE_WHEEL_DEFAULT} "ENABLE_PYTHON" OFF) diff --git a/src/bindings/python/wheel/CMakeLists.txt b/src/bindings/python/wheel/CMakeLists.txt index b7e6939ba9f49b..dca9f6f0c9c753 100644 --- a/src/bindings/python/wheel/CMakeLists.txt +++ b/src/bindings/python/wheel/CMakeLists.txt @@ -2,6 +2,17 @@ # SPDX-License-Identifier: Apache-2.0 # +# define version (syncronize with tools/openvino_dev/CMakeLists.txt) + +if(DEFINED ENV{CI_BUILD_DEV_TAG} AND NOT "$ENV{CI_BUILD_DEV_TAG}" STREQUAL "") + set(WHEEL_VERSION "${OpenVINO_VERSION}.$ENV{CI_BUILD_DEV_TAG}" CACHE STRING "Version of this release" FORCE) + set(wheel_pre_release ON) +else() + set(WHEEL_VERSION ${OpenVINO_VERSION} CACHE STRING "Version of this release" FORCE) +endif() +set(WHEEL_BUILD "${OpenVINO_VERSION_BUILD}" CACHE STRING "Build number of this release" FORCE) + + # # Common vars used by setup.py # diff --git a/tools/openvino_dev/CMakeLists.txt b/tools/openvino_dev/CMakeLists.txt index a6dcdee5eebd29..bc28e62f8d27d6 100644 --- a/tools/openvino_dev/CMakeLists.txt +++ b/tools/openvino_dev/CMakeLists.txt @@ -2,6 +2,35 @@ # SPDX-License-Identifier: Apache-2.0 # +cmake_minimum_required (VERSION 3.13) + +project(OpenVINODevPython DESCRIPTION "OpenVINO Python Development tools") + +# +# Packages & settings +# + +if(NOT DEFINED OpenVINO_SOURCE_DIR) + get_filename_component(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." REALPATH) +endif() + +find_package(IEDevScripts REQUIRED + PATHS "${OpenVINO_SOURCE_DIR}/cmake/developer_package" + NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH) + +# define version (syncronize with src/bindings/python/wheel/CMakeLists.txt) + +if(DEFINED ENV{CI_BUILD_DEV_TAG} AND NOT "$ENV{CI_BUILD_DEV_TAG}" STREQUAL "") + set(WHEEL_VERSION "${OpenVINO_VERSION}.$ENV{CI_BUILD_DEV_TAG}" CACHE STRING "Version of this release" FORCE) + set(wheel_pre_release ON) +else() + set(WHEEL_VERSION ${OpenVINO_VERSION} CACHE STRING "Version of this release" FORCE) +endif() +set(WHEEL_BUILD "${OpenVINO_VERSION_BUILD}" CACHE STRING "Build number of this release" FORCE) + +# openvino_dev build + set(SETUP_PY "${CMAKE_CURRENT_SOURCE_DIR}/setup.py") set(openvino_wheel_name "openvino_dev-${WHEEL_VERSION}-${WHEEL_BUILD}-py3-none-any.whl") @@ -17,13 +46,16 @@ add_custom_command(OUTPUT ${openvino_wheel_path} --quiet COMMAND ${CMAKE_COMMAND} -E env OPENVINO_VERSION=${WHEEL_VERSION} ${PYTHON_EXECUTABLE} ${SETUP_PY} clean - DEPENDS ie_wheel WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Building Python wheel ${openvino_wheel_name}" VERBATIM) add_custom_target(openvino_dev_wheel ALL DEPENDS ${openvino_wheel_path}) +if(TARGET ie_wheel) + add_dependencies(openvino_dev_wheel ie_wheel) +endif() + # install ie_cpack_add_component(${OV_CPACK_COMP_PYTHON_WHEELS} HIDDEN)