From 00618a429bfb4e1ca3cbca941dfd236338ae765f Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 16 Oct 2023 12:54:30 +0400 Subject: [PATCH] Relocatable OpenVINO Dev package improvements (#20461) --- ...DeveloperPackageConfigRelocatable.cmake.in | 4 +--- src/bindings/python/CMakeLists.txt | 21 ++++++++++--------- thirdparty/dependencies.cmake | 21 +------------------ thirdparty/pugixml | 2 +- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/cmake/templates/OpenVINODeveloperPackageConfigRelocatable.cmake.in b/cmake/templates/OpenVINODeveloperPackageConfigRelocatable.cmake.in index ed9826e663e..a4cdb93d387 100644 --- a/cmake/templates/OpenVINODeveloperPackageConfigRelocatable.cmake.in +++ b/cmake/templates/OpenVINODeveloperPackageConfigRelocatable.cmake.in @@ -9,9 +9,7 @@ include(CMakeFindDependencyMacro) # Variables to export in plugin's projects set(ov_options "@OV_OPTIONS@") -list(APPEND ov_options CMAKE_CXX_COMPILER_LAUNCHER CMAKE_C_COMPILER_LAUNCHER - CMAKE_CXX_LINKER_LAUNCHER CMAKE_C_LINKER_LAUNCHER - CMAKE_INSTALL_PREFIX CPACK_GENERATOR) +list(APPEND ov_options CPACK_GENERATOR) if(APPLE) list(APPEND ov_options CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET) diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt index 89d21c8a7c9..a2e8945a807 100644 --- a/src/bindings/python/CMakeLists.txt +++ b/src/bindings/python/CMakeLists.txt @@ -28,6 +28,8 @@ if(NOT DEFINED OpenVINO_SOURCE_DIR) if(NOT EXISTS "${OpenVINO_BINARY_DIR}/cmake_install.cmake") set(OpenVINODeveloperPackage_RELOCATABLE ON) endif() + + set(OpenVINO_SOURCE_DIR "${OpenVINOPython_SOURCE_DIR}/../../../") endif() if(NOT DEFINED OpenVINODeveloperPackage_RELOCATABLE) @@ -154,8 +156,8 @@ endfunction() set(INIT_FILES_RUNTIME "${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py" "${OpenVINOPython_SOURCE_DIR}/src/compatibility/openvino/__init__.py" - "${OpenVINOPython_SOURCE_DIR}/../../../tools/ovc/openvino/__init__.py" - "${OpenVINOPython_SOURCE_DIR}/../../../tools/benchmark_tool/openvino/__init__.py") + "${OpenVINO_SOURCE_DIR}/tools/ovc/openvino/__init__.py" + "${OpenVINO_SOURCE_DIR}/tools/benchmark_tool/openvino/__init__.py") ov_check_init_files_alignment("${INIT_FILES_RUNTIME}") @@ -319,15 +321,15 @@ macro(ov_define_setup_py_dependencies) "${CMAKE_CURRENT_SOURCE_DIR}/wheel/setup.py" "${OpenVINOPython_SOURCE_DIR}/requirements.txt" "${OpenVINOPython_SOURCE_DIR}/wheel/readme.txt" - "${OpenVINOPython_SOURCE_DIR}/../../../LICENSE" - "${OpenVINOPython_SOURCE_DIR}/../../../licensing/onednn_third-party-programs.txt" - "${OpenVINOPython_SOURCE_DIR}/../../../licensing/runtime-third-party-programs.txt" - "${OpenVINOPython_SOURCE_DIR}/../../../licensing/tbb_third-party-programs.txt" - "${OpenVINOPython_SOURCE_DIR}/../../../docs/install_guides/pypi-openvino-rt.md") + "${OpenVINO_SOURCE_DIR}/LICENSE" + "${OpenVINO_SOURCE_DIR}/licensing/onednn_third-party-programs.txt" + "${OpenVINO_SOURCE_DIR}/licensing/runtime-third-party-programs.txt" + "${OpenVINO_SOURCE_DIR}/licensing/tbb_third-party-programs.txt" + "${OpenVINO_SOURCE_DIR}/docs/install_guides/pypi-openvino-rt.md") if(wheel_pre_release) list(APPEND ov_setup_py_deps - "${OpenVINOPython_SOURCE_DIR}/../../../docs/install_guides/pre-release-note.md") + "${OpenVINO_SOURCE_DIR}/docs/install_guides/pre-release-note.md") endif() endmacro() @@ -404,9 +406,8 @@ if(ENABLE_TESTS) endif() if(OpenVINODeveloperPackage_FOUND) - # TODO: understand whether it's required # provides a callback function to describe each component in repo - include("${OpenVINOPython_SOURCE_DIR}/../../../cmake/packaging/packaging.cmake") + include("${OpenVINO_SOURCE_DIR}/cmake/packaging/packaging.cmake") ov_cpack(${OV_CPACK_COMPONENTS_ALL}) endif() diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake index 1524378287f..fac4752c318 100644 --- a/thirdparty/dependencies.cmake +++ b/thirdparty/dependencies.cmake @@ -266,26 +266,7 @@ if(NOT TARGET openvino::pugixml) function(ov_build_pugixml) function(ov_build_pugixml_static) set(BUILD_SHARED_LIBS OFF) - function(install) - cmake_parse_arguments(_install "" "EXPORT" "" ${ARGV}) - if(_install_EXPORT STREQUAL "pugixml-targets") - # does nothing! - # we need to override 'export' command to prevent cmake issue with multiple - # export sets for pugixml-target. Currently, it's installed only by OpenVINO - else() - _install(${ARGV}) - endif() - endfunction() - function(export) - cmake_parse_arguments(_export "" "EXPORT" "" ${ARGV}) - if(_export_EXPORT STREQUAL "pugixml-targets") - # does nothing! - # we need to override 'export' command to prevent cmake issue with multiple - # export sets for pugixml-target. Currently, it's installed only by OpenVINO - else() - _export(${ARGV}) - endif() - endfunction() + set(PUGIXML_INSTALL OFF CACHE BOOL "" FORCE) add_subdirectory(thirdparty/pugixml EXCLUDE_FROM_ALL) endfunction() ov_build_pugixml_static() diff --git a/thirdparty/pugixml b/thirdparty/pugixml index a0e06433631..2e357d19a32 160000 --- a/thirdparty/pugixml +++ b/thirdparty/pugixml @@ -1 +1 @@ -Subproject commit a0e064336317c9347a91224112af9933598714e9 +Subproject commit 2e357d19a3228c0a301727aac6bea6fecd982d21