diff --git a/CMakeLists.txt b/CMakeLists.txt index bb66118126d..fad19139a1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/cmake/developer_package/packaging/packaging.cmake b/cmake/developer_package/packaging/packaging.cmake index c20f5fff79a..b8c961a4f3f 100644 --- a/cmake/developer_package/packaging/packaging.cmake +++ b/cmake/developer_package/packaging/packaging.cmake @@ -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() diff --git a/cmake/developer_package/plugins/plugins.cmake b/cmake/developer_package/plugins/plugins.cmake index 9cbb650e242..d9ce2902376 100644 --- a/cmake/developer_package/plugins/plugins.cmake +++ b/cmake/developer_package/plugins/plugins.cmake @@ -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() diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake index 6a5df6e412c..c6d4a99712c 100644 --- a/cmake/extra_modules.cmake +++ b/cmake/extra_modules.cmake @@ -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() diff --git a/cmake/templates/OpenVINOConfig.cmake.in b/cmake/templates/OpenVINOConfig.cmake.in index 8f400480bcd..5036fbf2bc6 100644 --- a/cmake/templates/OpenVINOConfig.cmake.in +++ b/cmake/templates/OpenVINOConfig.cmake.in @@ -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() diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 5f7e4aa5621..ab5abf8024c 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -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 diff --git a/src/bindings/c/src/CMakeLists.txt b/src/bindings/c/src/CMakeLists.txt index 2e94da75466..063b248a4bc 100644 --- a/src/bindings/c/src/CMakeLists.txt +++ b/src/bindings/c/src/CMakeLists.txt @@ -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}) diff --git a/src/common/itt/CMakeLists.txt b/src/common/itt/CMakeLists.txt index b9d0a79392a..e5503592141 100644 --- a/src/common/itt/CMakeLists.txt +++ b/src/common/itt/CMakeLists.txt @@ -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 - $,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 diff --git a/src/common/low_precision_transformations/CMakeLists.txt b/src/common/low_precision_transformations/CMakeLists.txt index d097acfaf89..fea803cc7fd 100644 --- a/src/common/low_precision_transformations/CMakeLists.txt +++ b/src/common/low_precision_transformations/CMakeLists.txt @@ -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() diff --git a/src/common/transformations/CMakeLists.txt b/src/common/transformations/CMakeLists.txt index 196e91cb726..c2533d6838e 100644 --- a/src/common/transformations/CMakeLists.txt +++ b/src/common/transformations/CMakeLists.txt @@ -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. diff --git a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt index 14e8de3e30c..11ec9827631 100644 --- a/src/frontends/common/CMakeLists.txt +++ b/src/frontends/common/CMakeLists.txt @@ -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 diff --git a/src/plugins/intel_gna/legacy/CMakeLists.txt b/src/plugins/intel_gna/legacy/CMakeLists.txt index 31209350568..ac53784b1e4 100644 --- a/src/plugins/intel_gna/legacy/CMakeLists.txt +++ b/src/plugins/intel_gna/legacy/CMakeLists.txt @@ -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) diff --git a/src/plugins/intel_gna/tests/deprecated/helpers/CMakeLists.txt b/src/plugins/intel_gna/tests/deprecated/helpers/CMakeLists.txt index 7b55f773b71..845af496642 100644 --- a/src/plugins/intel_gna/tests/deprecated/helpers/CMakeLists.txt +++ b/src/plugins/intel_gna/tests/deprecated/helpers/CMakeLists.txt @@ -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) diff --git a/thirdparty/ittapi/CMakeLists.txt b/thirdparty/ittapi/CMakeLists.txt index d30d6f0136c..fe821f74fea 100644 --- a/thirdparty/ittapi/CMakeLists.txt +++ b/thirdparty/ittapi/CMakeLists.txt @@ -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()