Less argressive chages (#18591)

This commit is contained in:
Ilya Lavrenov 2023-07-18 19:54:00 +04:00 committed by GitHub
parent 2f3d4df342
commit 700677c5c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 55 additions and 65 deletions

View File

@ -69,16 +69,22 @@ if(NOT OV_GLIBC_VERSION VERSION_EQUAL 0.0)
message (STATUS "GLIBC_VERSION ......................... " ${OV_GLIBC_VERSION})
endif()
# remove file with exported developer targets to force its regeneration
# remove file with exported targets to force its regeneration
file(REMOVE "${CMAKE_BINARY_DIR}/ngraphTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/InferenceEngineTargets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
foreach(component IN LISTS openvino_export_components)
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
unset(${component} CACHE)
endforeach()
unset(openvino_export_components CACHE)
# remove exported developer targets to force its regeneration
macro(ov_clean_dev_targets)
foreach(component IN LISTS openvino_export_components)
file(REMOVE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake")
file(REMOVE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
unset(${component} CACHE)
endforeach()
unset(openvino_export_components CACHE)
unset(openvino_installed_targets CACHE)
endmacro()
ov_clean_dev_targets()
#
# Build

View File

@ -16,6 +16,12 @@ macro(ov_install_static_lib target comp)
if(target_type STREQUAL "STATIC_LIBRARY")
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL OFF)
endif()
# save all internal installed targets to filter them later in 'ov_generate_dev_package_config'
list(APPEND openvino_installed_targets ${target})
set(openvino_installed_targets "${openvino_installed_targets}" CACHE INTERNAL
"A list of OpenVINO internal targets" FORCE)
install(TARGETS ${target} EXPORT OpenVINOTargets
ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${comp} ${ARGN})
endif()

View File

@ -135,7 +135,7 @@ function(ov_add_plugin)
LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR}
COMPONENT ${install_component})
else()
ov_install_static_lib(${OV_PLUGIN_NAME} ${install_component})
ov_install_static_lib(${OV_PLUGIN_NAME} ${OV_CPACK_COMP_CORE})
endif()
endif()
endif()

View File

@ -39,15 +39,17 @@ function(ov_generate_dev_package_config)
find_package(OpenCV QUIET)
foreach(component IN LISTS openvino_export_components)
# TODO: remove legacy targets from tests
# string(FIND "${component}" "_legacy" index)
# if(index EQUAL -1)
# export all targets with prefix and use them during extra modules build
export(TARGETS ${${component}} NAMESPACE openvino::
# filter out targets which are installed by OpenVINOConfig.cmake static build case
set(exported_targets)
foreach(target IN LISTS ${component})
if(NOT target IN_LIST openvino_installed_targets)
list(APPEND exported_targets ${target})
endif()
endforeach()
# export all developer targets with prefix and use them during extra modules build
export(TARGETS ${exported_targets} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/ov_${component}_dev_targets.cmake")
list(APPEND all_dev_targets ${${component}})
# endif()
endforeach()
add_custom_target(ov_dev_targets DEPENDS ${all_dev_targets})
@ -76,10 +78,6 @@ endfunction()
#
function(register_extra_modules)
# post export
openvino_developer_export_targets(COMPONENT core_legacy TARGETS inference_engine)
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ngraph)
set(InferenceEngineDeveloperPackage_DIR "${CMAKE_CURRENT_BINARY_DIR}/build-modules")
set(OpenVINODeveloperPackage_DIR "${CMAKE_BINARY_DIR}/build-modules")
set(OpenVINO_DIR "${CMAKE_BINARY_DIR}")
@ -94,12 +92,12 @@ function(register_extra_modules)
file(WRITE "${devconfig_file}" "\# !! AUTOGENERATED: DON'T EDIT !!\n\n")
foreach(target IN LISTS ${openvino_export_components})
if(target)
foreach(targets_list IN LISTS ${openvino_export_components})
foreach(target IN LISTS targets_list)
file(APPEND "${devconfig_file}" "if(NOT TARGET ${NS}::${target})
add_library(${NS}::${target} ALIAS ${target})
endif()\n")
endif()
endforeach()
endforeach()
endfunction()

View File

@ -343,7 +343,8 @@ endmacro()
macro(_ov_find_intel_cpu_dependencies)
set(_OV_ENABLE_CPU_ACL "@DNNL_USE_ACL@")
if(_OV_ENABLE_CPU_ACL)
if(_ov_as_external_package)
set(_ov_in_install_tree "@PACKAGE_ARM_COMPUTE_LIB_DIR@")
if(_ov_in_install_tree)
set_and_check(ARM_COMPUTE_LIB_DIR "@PACKAGE_ARM_COMPUTE_LIB_DIR@")
set(ACL_DIR "${CMAKE_CURRENT_LIST_DIR}")
else()
@ -352,8 +353,8 @@ macro(_ov_find_intel_cpu_dependencies)
_ov_find_dependency(ACL)
unset(_ov_in_install_tree)
unset(ARM_COMPUTE_LIB_DIR)
unset(_ov_find_acl_path)
endif()
unset(_OV_ENABLE_CPU_ACL)
endmacro()

View File

@ -5,14 +5,7 @@
add_subdirectory(cpp)
add_subdirectory(c)
# used by tests_deprecated
if(TARGET format_reader)
install(TARGETS format_reader
ARCHIVE DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
endif()
openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)
openvino_developer_export_targets(COMPONENT samples TARGETS format_reader ie_samples_utils)
#
# Install

View File

@ -38,24 +38,24 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME runtime::c)
ov_add_library_version(${TARGET_NAME})
export(TARGETS ${TARGET_NAME} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")
# install
ov_cpack_add_component(${OV_CPACK_COMP_CORE_C} HIDDEN)
ov_cpack_add_component(${OV_CPACK_COMP_CORE_C_DEV} HIDDEN)
install(TARGETS ${TARGET_NAME} EXPORT OpenVINOTargets
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
NAMELINK_COMPONENT ${OV_CPACK_COMP_CORE_C_DEV}
INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR}
${OV_CPACK_INCLUDEDIR}/ie)
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${OV_CPACK_COMP_CORE_C}
NAMELINK_COMPONENT ${OV_CPACK_COMP_CORE_C_DEV}
INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR}
${OV_CPACK_INCLUDEDIR}/ie)
install(DIRECTORY ${OpenVINO_C_API_SOURCE_DIR}/include/c_api
DESTINATION ${OV_CPACK_INCLUDEDIR}/ie
COMPONENT ${OV_CPACK_COMP_CORE_C_DEV})
DESTINATION ${OV_CPACK_INCLUDEDIR}/ie
COMPONENT ${OV_CPACK_COMP_CORE_C_DEV})
install(DIRECTORY ${OpenVINO_C_API_SOURCE_DIR}/include/openvino/
DESTINATION ${OV_CPACK_INCLUDEDIR}/openvino
COMPONENT ${OV_CPACK_COMP_CORE_C_DEV})
DESTINATION ${OV_CPACK_INCLUDEDIR}/openvino
COMPONENT ${OV_CPACK_COMP_CORE_C_DEV})

View File

@ -12,8 +12,13 @@ add_library(openvino::itt ALIAS ${TARGET_NAME})
target_link_libraries(${TARGET_NAME} PUBLIC openvino::util)
if(ENABLE_PROFILING_ITT)
target_link_libraries(${TARGET_NAME} PUBLIC
$<IF:$<TARGET_EXISTS:ittapi::ittnotify>,ittapi::ittnotify,ittapi::ittapi>)
if(TARGET ittapi::ittnotify)
set(itt_dependency ittapi::ittnotify)
else()
set(itt_dependency ittapi::ittapi)
endif()
target_link_libraries(${TARGET_NAME} PUBLIC ${itt_dependency})
if(ENABLE_PROFILING_FILTER STREQUAL "ALL")
target_compile_definitions(${TARGET_NAME} PUBLIC
ENABLE_PROFILING_ALL

View File

@ -53,10 +53,6 @@ target_include_directories(${TARGET_NAME} INTERFACE
set_target_properties(${TARGET_NAME}_obj PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
# developer package
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()

View File

@ -58,10 +58,6 @@ ov_abi_free_target(${TARGET_NAME}_obj)
set_target_properties(${TARGET_NAME}_obj PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
# developer package
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
# temporary workaround for fatal error LNK1248: image size (1004722F6) exceeds maximum
# allowable size (FFFFFFFF)
# the symbolic debugging information will be stored in a separate .pdb file.

View File

@ -75,8 +75,6 @@ add_library(ngraph::${TARGET_NAME} ALIAS ${TARGET_NAME})
add_library(openvino::frontend::common ALIAS ${TARGET_NAME})
add_library(${TARGET_NAME}::static ALIAS ${TARGET_NAME})
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
# Installation rules header files
install(DIRECTORY ${FRONTEND_INCLUDE_DIR}/openvino

View File

@ -83,10 +83,6 @@ set_target_properties(${TARGET_NAME}_s PROPERTIES
set_target_properties(${TARGET_NAME} ${TARGET_NAME}_obj
PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO})
# developer package
openvino_developer_export_targets(COMPONENT core_legacy TARGETS ${TARGET_NAME})
# install
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE} OPTIONAL)

View File

@ -42,8 +42,3 @@ if (ENABLE_DATA)
add_dependencies(${TARGET_NAME} data)
add_dependencies(${TARGET_NAME}_s data)
endif()
# developer package
openvino_developer_export_targets(COMPONENT tests
TARGETS ieTestHelpers ieTestHelpers_s)

View File

@ -26,5 +26,5 @@ else()
add_library(ittapi::ittnotify ALIAS ittnotify)
openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittapi::ittnotify)
ov_install_static_lib(ittapi::ittnotify ${OV_CPACK_COMP_CORE})
ov_install_static_lib(ittnotify ${OV_CPACK_COMP_CORE})
endif()