2023-01-16 11:02:17 +04:00
# Copyright (C) 2018-2023 Intel Corporation
2021-09-09 13:41:11 +03:00
# SPDX-License-Identifier: Apache-2.0
#
2023-09-26 22:57:29 +04:00
if ( WIN32 )
# 3.16: FindPython3.cmake can find Python via -DPython3_EXECUTABLE
# 3.18: FindPython3.cmake can find Python automatically from virtualenv
cmake_minimum_required ( VERSION 3.16 )
else ( )
# 3.13: default choice
cmake_minimum_required ( VERSION 3.13 )
endif ( )
2021-09-10 15:31:27 +03:00
project ( OpenVINOPython DESCRIPTION "OpenVINO Runtime Python bindings" )
2022-08-16 14:43:30 +04:00
#
# Packages & settings
#
2021-11-03 18:00:14 +01:00
if ( NOT DEFINED OpenVINO_SOURCE_DIR )
2022-10-15 01:15:03 +04:00
find_package ( OpenVINODeveloperPackage REQUIRED
P A T H S " $ { I n f e r e n c e E n g i n e D e v e l o p e r P a c k a g e _ D I R } " )
2023-10-13 02:59:04 +04:00
# we assume that OpenVINODeveloperPackage is generated in OpenVINO build tree
2022-10-15 01:15:03 +04:00
set ( OpenVINO_BINARY_DIR "${OpenVINODeveloperPackage_DIR}" )
2023-10-13 02:59:04 +04:00
# but this can be invalid for cases of OpenVINODeveloperPackage relocatable installation
# so, we need to disable wheen generation for this case
if ( NOT EXISTS "${OpenVINO_BINARY_DIR}/cmake_install.cmake" )
set ( OpenVINODeveloperPackage_RELOCATABLE ON )
endif ( )
2023-10-16 12:54:30 +04:00
set ( OpenVINO_SOURCE_DIR "${OpenVINOPython_SOURCE_DIR}/../../../" )
2023-10-13 02:59:04 +04:00
endif ( )
if ( NOT DEFINED OpenVINODeveloperPackage_RELOCATABLE )
set ( OpenVINODeveloperPackage_RELOCATABLE OFF )
2021-11-03 18:00:14 +01:00
endif ( )
2023-09-26 22:57:29 +04:00
#
# Settings for FindPython3.cmake
#
if ( NOT DEFINED Python3_USE_STATIC_LIBS )
set ( Python3_USE_STATIC_LIBS OFF )
endif ( )
if ( NOT DEFINED Python3_FIND_VIRTUALENV )
set ( Python3_FIND_VIRTUALENV FIRST )
endif ( )
if ( NOT DEFINED Python3_FIND_IMPLEMENTATIONS )
set ( Python3_FIND_IMPLEMENTATIONS CPython PyPy )
endif ( )
if ( CMAKE_VERSION VERSION_GREATER_EQUAL 3.18 )
set ( python3_development_component Development.Module )
else ( )
set ( python3_development_component Development )
endif ( )
2022-08-16 14:43:30 +04:00
#
2022-08-25 20:15:21 +04:00
# Check python requirements
2022-08-16 14:43:30 +04:00
#
2023-09-19 00:11:05 +04:00
set ( ie_build_python_req "${OpenVINOPython_SOURCE_DIR}/src/compatibility/openvino/requirements-dev.txt" )
2022-08-16 14:43:30 +04:00
function ( ov_check_python_build_conditions )
2022-08-25 20:15:21 +04:00
# user explicitly specified ENABLE_PYTHON=ON
if ( ENABLE_PYTHON )
set ( find_package_mode REQUIRED )
set ( message_mode FATAL_ERROR )
else ( )
set ( find_package_mode QUIET )
set ( message_mode WARNING )
endif ( )
2023-09-26 22:57:29 +04:00
find_package ( Python3 ${ find_package_mode } COMPONENTS Interpreter ${ python3_development_component } )
if ( Python3_Development.Module_FOUND OR Python3_Development_FOUND )
message ( STATUS "Python3 executable: ${Python3_EXECUTABLE}" )
message ( STATUS "Python3 version: ${Python3_VERSION}" )
if ( Python3_PyPy_VERSION )
message ( STATUS "Python3 PyPy version: ${Python3_PyPy_VERSION}" )
2023-04-29 04:34:10 +04:00
endif ( )
2023-09-26 22:57:29 +04:00
message ( STATUS "Python3 interpreter ID: ${Python3_INTERPRETER_ID}" )
if ( Python3_SOABI )
message ( STATUS "Python3 SOABI: ${Python3_SOABI}" )
2023-05-23 00:31:35 +04:00
endif ( )
2023-09-26 22:57:29 +04:00
if ( PYTHON_MODULE_EXTENSION )
message ( STATUS "PYTHON_MODULE_EXTENSION: ${PYTHON_MODULE_EXTENSION}" )
2022-08-18 08:31:23 +04:00
endif ( )
2023-09-26 22:57:29 +04:00
message ( STATUS "Python3 include dirs: ${Python3_INCLUDE_DIRS}" )
message ( STATUS "Python3 libraries: ${Python3_LIBRARIES}" )
2022-08-18 08:31:23 +04:00
else ( )
2023-09-26 22:57:29 +04:00
message ( ${ message_mode } "Python 3.x Interpreter and Development.Module components are not found. OpenVINO Python API will be turned off (ENABLE_PYTHON is OFF)" )
2022-08-16 14:43:30 +04:00
endif ( )
2022-08-25 20:15:21 +04:00
# check for Cython requirement for build IE API 1.0
2023-09-19 00:11:05 +04:00
ov_check_pip_packages ( REQUIREMENTS_FILE ${ ie_build_python_req }
R E S U L T _ V A R i e _ b u i l d _ p y t h o n _ r e q _ F O U N D
W A R N I N G _ M E S S A G E " i n s t a l l p y t h o n 3 - m p i p i n s t a l l - r $ { i e _ b u i l d _ p y t h o n _ r e q } f o r I E A P I 1 . 0 r e q u i r e m e n t s "
2023-02-19 16:22:18 +04:00
M E S S A G E _ M O D E T R A C E )
2022-08-16 14:43:30 +04:00
# cython can be installed as a debian package, so pip requirements can be unsatisfied
# so, let's check to find cython anyway
2023-09-19 00:11:05 +04:00
if ( NOT ie_build_python_req_FOUND )
2022-08-16 14:43:30 +04:00
find_package ( Cython QUIET
P A T H S " $ { O p e n V I N O P y t h o n _ S O U R C E _ D I R } / s r c / c o m p a t i b i l i t y / o p e n v i n o / c m a k e "
N O _ C M A K E _ F I N D _ R O O T _ P A T H
N O _ D E F A U L T _ P A T H )
if ( CYTHON_VERSION VERSION_GREATER_EQUAL 0.29 )
2023-09-19 00:11:05 +04:00
set ( ie_build_python_req_FOUND ON )
2022-08-16 14:43:30 +04:00
else ( )
2023-09-19 00:11:05 +04:00
message ( ${ message_mode } "Python requirements '${ie_build_python_req}' are missed, IE Python API 1.0 will not be built (ENABLE_PYTHON is OFF)" )
2022-08-16 14:43:30 +04:00
endif ( )
endif ( )
2023-03-05 10:46:53 +04:00
if ( NOT OV_GENERATOR_MULTI_CONFIG AND CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_DEBUG_POSTFIX )
2022-08-18 08:31:23 +04:00
set ( python_debug ON )
2022-08-25 20:15:21 +04:00
message ( ${ message_mode } "Building python bindings in debug configuration is not supported on your platform (ENABLE_PYTHON is OFF)" )
2022-08-18 08:31:23 +04:00
else ( )
set ( python_debug OFF )
endif ( )
2023-09-26 22:57:29 +04:00
if ( ( Python3_Development.Module_FOUND OR Python3_Development_FOUND ) AND
i e _ b u i l d _ p y t h o n _ r e q _ F O U N D A N D N O T p y t h o n _ d e b u g )
2022-08-25 20:15:21 +04:00
set ( ENABLE_PYTHON_DEFAULT ON PARENT_SCOPE )
else ( )
set ( ENABLE_PYTHON_DEFAULT OFF PARENT_SCOPE )
endif ( )
# to disable API 1.0
2023-09-19 00:11:05 +04:00
set ( ie_build_python_req_FOUND ${ ie_build_python_req_FOUND } PARENT_SCOPE )
2022-08-16 14:43:30 +04:00
endfunction ( )
ov_check_python_build_conditions ( )
2023-09-18 22:36:13 +02:00
# check __init__.py files alignment
2023-10-11 09:53:34 +02:00
function ( ov_check_init_files_alignment init_files )
2023-09-18 22:36:13 +02:00
# check the files in pairs
list ( LENGTH init_files init_files_count )
math ( EXPR file_loop_range "${init_files_count}-2" )
foreach ( init_file_idx RANGE 0 ${ file_loop_range } )
math ( EXPR init_file_idx_next "${init_file_idx}+1" )
list ( GET init_files ${ init_file_idx } file1 )
list ( GET init_files ${ init_file_idx_next } file2 )
execute_process ( COMMAND ${ CMAKE_COMMAND } -E compare_files ${ file1 } ${ file2 }
R E S U L T _ V A R I A B L E c o m p a r e _ r e s u l t
)
if ( compare_result EQUAL 1 )
2023-10-11 09:53:34 +02:00
message ( FATAL_ERROR "The runtime __init__.py files are misaligned: ${file1} and ${file2}" )
2023-09-18 22:36:13 +02:00
endif ( )
endforeach ( )
endfunction ( )
2023-10-13 02:59:04 +04:00
set ( INIT_FILES_RUNTIME "${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py"
" $ { O p e n V I N O P y t h o n _ S O U R C E _ D I R } / s r c / c o m p a t i b i l i t y / o p e n v i n o / _ _ i n i t _ _ . p y "
2023-10-16 12:54:30 +04:00
" $ { O p e n V I N O _ S O U R C E _ D I R } / t o o l s / o v c / o p e n v i n o / _ _ i n i t _ _ . p y "
" $ { O p e n V I N O _ S O U R C E _ D I R } / t o o l s / b e n c h m a r k _ t o o l / o p e n v i n o / _ _ i n i t _ _ . p y " )
2023-10-11 09:53:34 +02:00
ov_check_init_files_alignment ( "${INIT_FILES_RUNTIME}" )
2023-09-18 22:36:13 +02:00
2023-10-09 22:30:32 +04:00
ov_option ( ENABLE_PYTHON "Enables OpenVINO Python API build" ${ ENABLE_PYTHON_DEFAULT } )
2022-08-16 14:43:30 +04:00
2022-08-25 20:15:21 +04:00
#
2022-08-16 14:43:30 +04:00
# Check for wheel package
2022-08-25 20:15:21 +04:00
#
# user explicitly specified ENABLE_WHEEL=ON
if ( ENABLE_WHEEL )
set ( find_package_mode REQUIRED )
set ( message_mode FATAL_ERROR )
else ( )
set ( find_package_mode QUIET )
set ( message_mode WARNING )
endif ( )
set ( wheel_reqs "${OpenVINOPython_SOURCE_DIR}/wheel/requirements-dev.txt" )
2022-08-16 14:43:30 +04:00
ov_check_pip_packages ( REQUIREMENTS_FILE "${OpenVINOPython_SOURCE_DIR}/wheel/requirements-dev.txt"
2022-09-26 11:33:50 +04:00
R E S U L T _ V A R E N A B L E _ W H E E L _ D E F A U L T
2022-08-16 14:43:30 +04:00
M E S S A G E _ M O D E W A R N I N G )
if ( LINUX )
find_host_program ( patchelf_program
N A M E S p a t c h e l f
D O C " P a t h t o p a t c h e l f t o o l " )
if ( NOT patchelf_program )
2022-08-25 20:15:21 +04:00
set ( ENABLE_WHEEL_DEFAULT OFF )
2023-11-22 13:19:11 +01:00
message ( ${ message_mode } "patchelf is not found. It is required to build OpenVINO Runtime wheel. Install via `pip install patchelf` or `apt install patchelf`." )
2022-08-16 14:43:30 +04:00
endif ( )
2022-04-05 22:16:32 +03:00
endif ( )
2023-06-23 09:17:02 +04:00
if ( CMAKE_VERSION VERSION_GREATER_EQUAL 3.15 )
set ( SETUP_PY_REQUIREMENTS_FOUND ON )
else ( )
2023-02-03 19:36:47 +04:00
message ( ${ message_mode } "Cmake version 3.15 and higher is required to build 'openvino' wheel. Provided version ${CMAKE_VERSION}" )
2023-06-23 09:17:02 +04:00
set ( SETUP_PY_REQUIREMENTS_FOUND OFF )
endif ( )
if ( NOT SETUP_PY_REQUIREMENTS_FOUND )
# setup.py requirements are importnant to build wheel
2022-11-17 00:03:34 +04:00
set ( ENABLE_WHEEL_DEFAULT OFF )
endif ( )
2022-10-15 01:15:03 +04:00
# this option should not be a part of OpenVINODeveloperPackage
2022-08-16 14:43:30 +04:00
# since wheels can be built only together with main OV build
2023-10-13 02:59:04 +04:00
ov_dependent_option ( ENABLE_WHEEL "Build wheel packages for PyPI" ${ ENABLE_WHEEL_DEFAULT } "ENABLE_PYTHON;NOT OpenVINODeveloperPackage_RELOCATABLE" OFF )
2022-08-16 14:43:30 +04:00
2022-10-15 01:15:03 +04:00
if ( NOT ENABLE_PYTHON )
if ( CMAKE_SOURCE_DIR STREQUAL OpenVINOPython_SOURCE_DIR )
2023-09-26 22:57:29 +04:00
message ( FATAL_ERROR "Python OpenVINO API build requirements are not satisfied. Please, install ${ie_build_python_req}" )
2022-10-15 01:15:03 +04:00
else ( )
return ( )
endif ( )
endif ( )
2023-06-23 09:17:02 +04:00
if ( NOT SETUP_PY_REQUIREMENTS_FOUND AND ENABLE_PYTHON_PACKAGING )
message ( FATAL_ERROR "Python cannot be packaged, because setup.py requirements are not satisfied (cmake version >= 3.15 is required, provided ${CMAKE_VERSION})" )
endif ( )
2022-08-16 14:43:30 +04:00
#
# Build the code
#
2022-09-26 11:33:50 +04:00
2023-09-26 22:57:29 +04:00
if ( Python3_VERSION_MINOR GREATER_EQUAL 11 )
set ( pybind11_min_version 2.9.2 )
else ( )
set ( pybind11_min_version 2.8.0 )
endif ( )
find_package ( Python3 REQUIRED COMPONENTS Interpreter ${ python3_development_component } )
2023-04-29 04:34:10 +04:00
find_package ( pybind11 ${ pybind11_min_version } QUIET )
2022-10-12 12:16:13 +04:00
if ( NOT pybind11_FOUND )
add_subdirectory ( thirdparty/pybind11 EXCLUDE_FROM_ALL )
endif ( )
2022-09-20 10:56:46 +02:00
add_subdirectory ( src/compatibility/pyngraph )
add_subdirectory ( src/pyopenvino )
2021-09-09 13:41:11 +03:00
2023-09-19 00:11:05 +04:00
if ( ie_build_python_req_FOUND )
2022-09-02 19:33:21 +04:00
add_subdirectory ( src/compatibility/openvino )
else ( )
message ( WARNING "NOTE: Python API for OpenVINO 1.0 is disabled" )
endif ( )
2023-06-23 09:17:02 +04:00
#
# Packaging
#
macro ( ov_define_setup_py_packaging_vars )
2023-09-26 22:57:29 +04:00
# Python3_VERSION_MAJOR and Python3_VERSION_MINOR are defined inside pybind11
set ( pyversion python ${ Python3_VERSION_MAJOR } . ${ Python3_VERSION_MINOR } )
2023-06-23 09:17:02 +04:00
# 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
set ( PY_PACKAGES_DIR ${ OV_CPACK_PYTHONDIR } )
set ( TBB_LIBS_DIR runtime/3rdparty/tbb/lib )
if ( WIN32 )
set ( TBB_LIBS_DIR runtime/3rdparty/tbb/bin )
endif ( )
set ( PUGIXML_LIBS_DIR runtime/3rdparty/pugixml/lib )
2023-08-17 16:45:18 +04:00
if ( USE_BUILD_TYPE_SUBFOLDER )
set ( build_type ${ CMAKE_BUILD_TYPE } )
else ( )
set ( build_type $< CONFIG > )
endif ( )
2023-06-23 09:17:02 +04:00
# define setup.py running environment
set ( setup_py_env ${ CMAKE_COMMAND } -E env
# for cross-compilation
S E T U P T O O L S _ E X T _ S U F F I X = $ { P Y T H O N _ M O D U L E _ E X T E N S I O N }
# versions
W H E E L _ V E R S I O N = $ { W H E E L _ V E R S I O N }
W H E E L _ B U I L D = $ { W H E E L _ B U I L D }
# build locations
O P E N V I N O _ B I N A R Y _ D I R = $ { O p e n V I N O _ B I N A R Y _ D I R }
O P E N V I N O _ P Y T H O N _ B I N A R Y _ D I R = $ { O p e n V I N O P y t h o n _ B I N A R Y _ D I R }
2023-07-13 23:12:07 +04:00
# to create proper directories for BA, OVC tools
C P A C K _ G E N E R A T O R = $ { C P A C K _ G E N E R A T O R }
2023-08-17 16:45:18 +04:00
# propogate build type
B U I L D _ T Y P E = $ { b u i l d _ t y p e }
2023-06-23 09:17:02 +04:00
# variables to reflect cpack locations
2023-08-17 16:45:18 +04:00
O V _ R U N T I M E _ L I B S _ D I R = $ { O V _ C P A C K _ R U N T I M E D I R }
2023-06-23 09:17:02 +04:00
T B B _ L I B S _ D I R = $ { T B B _ L I B S _ D I R }
P U G I X M L _ L I B S _ D I R = $ { P U G I X M L _ L I B S _ D I R }
P Y _ P A C K A G E S _ D I R = $ { P Y _ P A C K A G E S _ D I R } )
endmacro ( )
macro ( ov_define_setup_py_dependencies )
foreach ( _target
# Python API dependencies
_ p y n g r a p h p y o p e n v i n o p y _ o v _ f r o n t e n d s
# legacy Python API 1.0 dependencies (remove before 2024.0 release)
i e _ a p i c o n s t a n t s
# plugins
o v _ p l u g i n s
# frontends
o v _ f r o n t e n d s )
if ( TARGET ${ _target } )
list ( APPEND ov_setup_py_deps ${ _target } )
endif ( )
endforeach ( )
file ( GLOB_RECURSE compat_ngraph_py_files ${ OpenVINOPython_SOURCE_DIR } /src/compatibility/*.py )
file ( GLOB_RECURSE openvino_py_files ${ OpenVINOPython_SOURCE_DIR } /src/openvino/*.py )
list ( APPEND ov_setup_py_deps
$ { o p e n v i n o _ p y _ f i l e s }
$ { c o m p a t _ n g r a p h _ p y _ f i l e s }
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / w h e e l / s e t u p . p y "
" $ { O p e n V I N O P y t h o n _ S O U R C E _ D I R } / r e q u i r e m e n t s . t x t "
" $ { O p e n V I N O P y t h o n _ S O U R C E _ D I R } / w h e e l / r e a d m e . t x t "
2023-10-16 12:54:30 +04:00
" $ { O p e n V I N O _ S O U R C E _ D I R } / L I C E N S E "
" $ { O p e n V I N O _ S O U R C E _ D I R } / l i c e n s i n g / o n e d n n _ t h i r d - p a r t y - p r o g r a m s . t x t "
" $ { O p e n V I N O _ S O U R C E _ D I R } / l i c e n s i n g / r u n t i m e - t h i r d - p a r t y - p r o g r a m s . t x t "
" $ { O p e n V I N O _ S O U R C E _ D I R } / l i c e n s i n g / t b b _ t h i r d - p a r t y - p r o g r a m s . t x t "
" $ { O p e n V I N O _ S O U R C E _ D I R } / d o c s / i n s t a l l _ g u i d e s / p y p i - o p e n v i n o - r t . m d " )
2023-06-23 09:17:02 +04:00
if ( wheel_pre_release )
list ( APPEND ov_setup_py_deps
2023-10-16 12:54:30 +04:00
" $ { O p e n V I N O _ S O U R C E _ D I R } / d o c s / i n s t a l l _ g u i d e s / p r e - r e l e a s e - n o t e . m d " )
2023-06-23 09:17:02 +04:00
endif ( )
endmacro ( )
ov_define_setup_py_packaging_vars ( )
ov_define_setup_py_dependencies ( )
2022-01-11 16:55:18 +03:00
if ( ENABLE_WHEEL )
add_subdirectory ( wheel )
endif ( )
2023-06-23 09:17:02 +04:00
#
# Target, which creates python install tree for cases of DEB | RPM packages
#
if ( ENABLE_PYTHON_PACKAGING )
# site-packages depending on package type
2023-09-26 22:57:29 +04:00
set ( python_xy "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" )
2023-06-23 09:17:02 +04:00
if ( CPACK_GENERATOR STREQUAL "DEB" )
2023-09-26 22:57:29 +04:00
set ( python_versioned_folder "python${Python3_VERSION_MAJOR}" )
2023-06-23 09:17:02 +04:00
set ( ov_site_packages "dist-packages" )
elseif ( CPACK_GENERATOR STREQUAL "RPM" )
set ( python_versioned_folder "python${python_xy}" )
set ( ov_site_packages "site-packages" )
endif ( )
set ( python_package_prefix "${CMAKE_CURRENT_BINARY_DIR}/install_${pyversion}" )
set ( install_lib "${python_package_prefix}/lib/${python_versioned_folder}/${ov_site_packages}" )
set ( meta_info_subdir "openvino-${OpenVINO_VERSION}-py${python_xy}.egg-info" )
set ( meta_info_file "${install_lib}/${meta_info_subdir}/PKG-INFO" )
add_custom_command ( OUTPUT ${ meta_info_file }
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y
" $ { p y t h o n _ p a c k a g e _ p r e f i x } "
C O M M A N D $ { s e t u p _ p y _ e n v }
2023-07-13 23:12:07 +04:00
# variables to reflect options (extensions only or full wheel package)
P Y T H O N _ E X T E N S I O N S _ O N L Y = O N
S K I P _ R P A T H = O N
2023-09-26 22:57:29 +04:00
" $ { P y t h o n 3 _ E X E C U T A B L E } " " $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / w h e e l / s e t u p . p y "
2023-06-23 09:17:02 +04:00
- - n o - u s e r - c f g
- - q u i e t
b u i l d
- - e x e c u t a b l e " / u s r / b i n / p y t h o n 3 "
b u i l d _ e x t
i n s t a l l
- - n o - c o m p i l e
- - p r e f i x " $ { p y t h o n _ p a c k a g e _ p r e f i x } "
- - i n s t a l l - l i b " $ { i n s t a l l _ l i b } "
- - i n s t a l l - s c r i p t s " $ { p y t h o n _ p a c k a g e _ p r e f i x } / b i n "
2023-08-14 17:45:23 +04:00
- - s i n g l e - v e r s i o n - e x t e r n a l l y - m a n a g e d
- - r e c o r d = i n s t a l l e d . t x t
2023-06-23 09:17:02 +04:00
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } "
D E P E N D S $ { o v _ s e t u p _ p y _ d e p s }
C O M M E N T " C r e a t e p y t h o n p a c k a g e w i t h $ { m e t a _ i n f o _ s u b d i r } f o l d e r " )
add_custom_target ( _python_api_package ALL DEPENDS ${ meta_info_file } )
# install python package, which will be later packed into DEB | RPM
2023-07-20 17:46:16 +04:00
ov_cpack_add_component ( ${ OV_CPACK_COMP_PYTHON_OPENVINO } _package_ ${ pyversion } HIDDEN )
2023-06-23 09:17:02 +04:00
install ( DIRECTORY ${ python_package_prefix } /
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ P R E F I X }
C O M P O N E N T $ { O V _ C P A C K _ C O M P _ P Y T H O N _ O P E N V I N O _ P A C K A G E } _ $ { p y v e r s i o n }
$ { O V _ C P A C K _ C O M P _ P Y T H O N _ O P E N V I N O _ P A C K A G E _ E X C L U D E _ A L L }
U S E _ S O U R C E _ P E R M I S S I O N S )
endif ( )
#
# Tests
#
2022-09-20 10:56:46 +02:00
if ( ENABLE_TESTS )
2022-02-03 20:03:41 +03:00
add_subdirectory ( tests/mock/mock_py_frontend )
2021-09-09 13:41:11 +03:00
add_subdirectory ( tests/mock/pyngraph_fe_mock_api )
2023-10-25 22:16:01 +02:00
install ( FILES constraints.txt
D E S T I N A T I O N t e s t s / b i n d i n g s / p y t h o n
C O M P O N E N T t e s t s
E X C L U D E _ F R O M _ A L L )
install ( FILES src/openvino/preprocess/torchvision/requirements.txt
D E S T I N A T I O N t e s t s / p y t h o n / p r e p r o c e s s / t o r c h v i s i o n
C O M P O N E N T t e s t s
E X C L U D E _ F R O M _ A L L )
2021-09-09 13:41:11 +03:00
endif ( )
2021-11-03 18:00:14 +01:00
2022-10-15 01:15:03 +04:00
if ( OpenVINODeveloperPackage_FOUND )
2023-08-09 21:10:13 +04:00
# provides a callback function to describe each component in repo
2023-10-16 12:54:30 +04:00
include ( "${OpenVINO_SOURCE_DIR}/cmake/packaging/packaging.cmake" )
2023-08-09 21:10:13 +04:00
2023-10-09 22:30:32 +04:00
ov_cpack ( ${ OV_CPACK_COMPONENTS_ALL } )
2021-11-03 18:00:14 +01:00
endif ( )