From 0ab57298f8530e2ad656c93e2afb767f41597cb6 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 3 Dec 2021 13:10:17 +0300 Subject: [PATCH] Export frontend_common as dev target --- cmake/extra_modules.cmake | 2 +- samples/c/common/opencv_c_wrapper/CMakeLists.txt | 2 +- samples/cpp/common/format_reader/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- src/bindings/c/src/CMakeLists.txt | 2 ++ src/common/CMakeLists.txt | 3 +-- src/core/tests/frontend/CMakeLists.txt | 2 +- src/core/tests/frontend/shared/CMakeLists.txt | 2 +- src/core/tests/onnx_test_util/CMakeLists.txt | 2 +- src/core/tests/runtime/CMakeLists.txt | 2 +- src/core/tests/runtime/ie/CMakeLists.txt | 2 +- src/core/tests/runtime/interpreter/CMakeLists.txt | 2 +- src/frontends/common/CMakeLists.txt | 3 +++ 13 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake index 3b22125d009..7f75ee8bda4 100644 --- a/cmake/extra_modules.cmake +++ b/cmake/extra_modules.cmake @@ -13,7 +13,7 @@ function(ie_generate_dev_package_config) APPEND FILE "${CMAKE_BINARY_DIR}/${component}_dev_targets.cmake") list(APPEND all_dev_targets ${${component}}) endforeach() - add_custom_target(ie_dev_targets ALL DEPENDS ${all_dev_targets}) + add_custom_target(ie_dev_targets DEPENDS ${all_dev_targets}) configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/InferenceEngineDeveloperPackageConfig.cmake.in" "${CMAKE_BINARY_DIR}/InferenceEngineDeveloperPackageConfig.cmake" diff --git a/samples/c/common/opencv_c_wrapper/CMakeLists.txt b/samples/c/common/opencv_c_wrapper/CMakeLists.txt index 9550b217edf..80eb5a30513 100644 --- a/samples/c/common/opencv_c_wrapper/CMakeLists.txt +++ b/samples/c/common/opencv_c_wrapper/CMakeLists.txt @@ -9,7 +9,7 @@ file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h) # create library -add_library(${TARGET_NAME} SHARED ${HEADERS} ${SOURCES}) +add_library(${TARGET_NAME} SHARED EXCLUDE_FROM_ALL ${HEADERS} ${SOURCES}) # Find OpenCV components if exist find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) diff --git a/samples/cpp/common/format_reader/CMakeLists.txt b/samples/cpp/common/format_reader/CMakeLists.txt index 3ce377270a9..d97d55d327a 100644 --- a/samples/cpp/common/format_reader/CMakeLists.txt +++ b/samples/cpp/common/format_reader/CMakeLists.txt @@ -13,7 +13,7 @@ source_group("src" FILES ${LIBRARY_SRC}) source_group("include" FILES ${LIBRARY_HEADERS}) # Create library file from sources. -add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${LIBRARY_HEADERS}) +add_library(${TARGET_NAME} SHARED EXCLUDE_FROM_ALL ${MAIN_SRC} ${LIBRARY_HEADERS}) # Find OpenCV components if exist find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a98635a36a3..f8468a53b77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,7 +7,7 @@ if(ENABLE_LTO) endif() add_definitions(-DPROJECT_ROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}") -add_custom_target(ov_runtime_libraries ALL) +add_custom_target(ov_runtime_libraries) # TODO: Fix Wall for core, frontends, tests and c binding add_subdirectory(core) diff --git a/src/bindings/c/src/CMakeLists.txt b/src/bindings/c/src/CMakeLists.txt index 4a60879bb52..3d59bf9f5b9 100644 --- a/src/bindings/c/src/CMakeLists.txt +++ b/src/bindings/c/src/CMakeLists.txt @@ -34,6 +34,8 @@ set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME runtime::c) export(TARGETS ${TARGET_NAME} NAMESPACE openvino:: APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") +openvino_developer_export_targets(COMPONENT inference_engine TARGETS ${TARGET_NAME}) + # install ie_cpack_add_component(core_c DEPENDS core) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 35f24cd8c13..43cbbe5dfcc 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -15,5 +15,4 @@ add_subdirectory(low_precision_transformations) add_dependencies(ov_runtime_libraries inference_engine_legacy inference_engine_transformations inference_engine_lp_transformations - inference_engine_preproc - inference_engine_snippets) + inference_engine_preproc) diff --git a/src/core/tests/frontend/CMakeLists.txt b/src/core/tests/frontend/CMakeLists.txt index 157cfe31aba..5f38a2daa5f 100644 --- a/src/core/tests/frontend/CMakeLists.txt +++ b/src/core/tests/frontend/CMakeLists.txt @@ -17,7 +17,7 @@ endif() set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/mock_frontend.cpp) set(MOCK1_FE_NAME mock1_ov_frontend) -add_library(${MOCK1_FE_NAME} SHARED ${SRC}) +add_library(${MOCK1_FE_NAME} SHARED EXCLUDE_FROM_ALL ${SRC}) target_compile_definitions(${MOCK1_FE_NAME} PRIVATE "-DMOCK_VARIANT=\"1\"") diff --git a/src/core/tests/frontend/shared/CMakeLists.txt b/src/core/tests/frontend/shared/CMakeLists.txt index ffcc6699b5f..a18c5ddbacd 100644 --- a/src/core/tests/frontend/shared/CMakeLists.txt +++ b/src/core/tests/frontend/shared/CMakeLists.txt @@ -7,7 +7,7 @@ set(TARGET_NAME "frontend_shared_test_classes") file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) -add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${LIBRARY_HEADERS}) +add_library(${TARGET_NAME} STATIC EXCLUDE_FROM_ALL ${LIBRARY_SRC} ${LIBRARY_HEADERS}) target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../..) diff --git a/src/core/tests/onnx_test_util/CMakeLists.txt b/src/core/tests/onnx_test_util/CMakeLists.txt index f3711f7f3c6..b2967d523cd 100644 --- a/src/core/tests/onnx_test_util/CMakeLists.txt +++ b/src/core/tests/onnx_test_util/CMakeLists.txt @@ -4,7 +4,7 @@ file(GLOB_RECURSE ONNX_UTIL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp") -add_library(onnx_test_util STATIC ${ONNX_UTIL_SRC}) +add_library(onnx_test_util STATIC EXCLUDE_FROM_ALL ${ONNX_UTIL_SRC}) ie_faster_build(onnx_test_util UNITY) diff --git a/src/core/tests/runtime/CMakeLists.txt b/src/core/tests/runtime/CMakeLists.txt index 27bdecb4097..7198c8fe4a4 100644 --- a/src/core/tests/runtime/CMakeLists.txt +++ b/src/core/tests/runtime/CMakeLists.txt @@ -20,7 +20,7 @@ set (SRC pass/shape_relevance.hpp ) -add_library(ngraph_backend SHARED ${SRC}) +add_library(ngraph_backend SHARED EXCLUDE_FROM_ALL ${SRC}) ie_faster_build(ngraph_backend UNITY) diff --git a/src/core/tests/runtime/ie/CMakeLists.txt b/src/core/tests/runtime/ie/CMakeLists.txt index b46a608b6eb..adedc806222 100644 --- a/src/core/tests/runtime/ie/CMakeLists.txt +++ b/src/core/tests/runtime/ie/CMakeLists.txt @@ -12,7 +12,7 @@ set(SRC ie_executable.hpp ) -add_library(ie_backend SHARED ${SRC}) +add_library(ie_backend SHARED EXCLUDE_FROM_ALL ${SRC}) ie_faster_build(ie_backend UNITY) diff --git a/src/core/tests/runtime/interpreter/CMakeLists.txt b/src/core/tests/runtime/interpreter/CMakeLists.txt index 492e205fc8c..484b380227c 100644 --- a/src/core/tests/runtime/interpreter/CMakeLists.txt +++ b/src/core/tests/runtime/interpreter/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # -add_library(interpreter_backend SHARED int_backend.cpp int_executable.cpp evaluates_map.cpp) +add_library(interpreter_backend SHARED EXCLUDE_FROM_ALL int_backend.cpp int_executable.cpp evaluates_map.cpp) ie_faster_build(interpreter_backend UNITY) diff --git a/src/frontends/common/CMakeLists.txt b/src/frontends/common/CMakeLists.txt index 13b5ff392b1..919cae2d091 100644 --- a/src/frontends/common/CMakeLists.txt +++ b/src/frontends/common/CMakeLists.txt @@ -71,9 +71,12 @@ else() add_library(${TARGET_NAME}::static ALIAS ${TARGET_NAME}) endif() +openvino_developer_export_targets(COMPONENT ngraph TARGETS ${TARGET_NAME}) + # Installation rules for shared version only set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME frontend::common) + install(TARGETS ${TARGET_NAME} EXPORT OpenVINOTargets RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT ngraph ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ngraph