From e0ae61b06ddcdef0ac3009673ad92c6747342a4b Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 9 Dec 2021 08:51:21 +0300 Subject: [PATCH] Added optional for exclude_from_all targets (#9100) --- cmake/developer_package/IEDevScriptsConfig.cmake | 2 +- src/common/legacy/CMakeLists.txt | 2 +- src/core/tests/frontend/CMakeLists.txt | 8 ++++---- src/core/tests/runtime/CMakeLists.txt | 8 ++++---- src/core/tests/runtime/ie/CMakeLists.txt | 8 ++++---- src/core/tests/runtime/interpreter/CMakeLists.txt | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmake/developer_package/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake index fcd8726f923..d4475a3e80e 100644 --- a/cmake/developer_package/IEDevScriptsConfig.cmake +++ b/cmake/developer_package/IEDevScriptsConfig.cmake @@ -207,7 +207,7 @@ endif() macro(ov_install_static_lib target comp) if(NOT BUILD_SHARED_LIBS) install(TARGETS ${target} EXPORT OpenVINOTargets - ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ${comp}) + ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} COMPONENT ${comp} ${ARGN}) endif() endmacro() diff --git a/src/common/legacy/CMakeLists.txt b/src/common/legacy/CMakeLists.txt index 1d3d94ba7c8..ba1b97c20e5 100644 --- a/src/common/legacy/CMakeLists.txt +++ b/src/common/legacy/CMakeLists.txt @@ -85,5 +85,5 @@ if(BUILD_SHARED_LIBS) RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core OPTIONAL LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core OPTIONAL) else() - ov_install_static_lib(${TARGET_NAME} core) + ov_install_static_lib(${TARGET_NAME} core OPTIONAL) endif() diff --git a/src/core/tests/frontend/CMakeLists.txt b/src/core/tests/frontend/CMakeLists.txt index 3a80f49ffa6..4baa5e86181 100644 --- a/src/core/tests/frontend/CMakeLists.txt +++ b/src/core/tests/frontend/CMakeLists.txt @@ -30,10 +30,10 @@ add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME}) if(BUILD_SHARED_LIBS OR NOT WIN32) install(TARGETS ${MOCK1_FE_NAME} - RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) else() install(TARGETS ${MOCK1_FE_NAME} - RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) endif() diff --git a/src/core/tests/runtime/CMakeLists.txt b/src/core/tests/runtime/CMakeLists.txt index 7198c8fe4a4..648c8d53a79 100644 --- a/src/core/tests/runtime/CMakeLists.txt +++ b/src/core/tests/runtime/CMakeLists.txt @@ -40,12 +40,12 @@ target_link_libraries(ngraph_backend PUBLIC ngraph ngraph::builder ngraph::refer target_include_directories(ngraph_backend PUBLIC $) install(TARGETS ngraph_backend - RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) if(NOT BUILD_SHARED_LIBS) install(TARGETS ngraph_backend - RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) endif() add_subdirectory(interpreter) diff --git a/src/core/tests/runtime/ie/CMakeLists.txt b/src/core/tests/runtime/ie/CMakeLists.txt index adedc806222..8c6cdd202eb 100644 --- a/src/core/tests/runtime/ie/CMakeLists.txt +++ b/src/core/tests/runtime/ie/CMakeLists.txt @@ -25,10 +25,10 @@ add_dependencies(ie_backend inference_engine) target_link_libraries(ie_backend PUBLIC ngraph_backend inference_engine) install(TARGETS ie_backend - RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) if(NOT BUILD_SHARED_LIBS) install(TARGETS ie_backend - RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) endif() diff --git a/src/core/tests/runtime/interpreter/CMakeLists.txt b/src/core/tests/runtime/interpreter/CMakeLists.txt index 484b380227c..e9d7744e12e 100644 --- a/src/core/tests/runtime/interpreter/CMakeLists.txt +++ b/src/core/tests/runtime/interpreter/CMakeLists.txt @@ -15,10 +15,10 @@ target_compile_definitions(interpreter_backend PRIVATE INTERPRETER_BACKEND_EXPOR target_link_libraries(interpreter_backend PUBLIC ngraph_backend PRIVATE ngraph_reference) install(TARGETS interpreter_backend - RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) if(NOT BUILD_SHARED_LIBS) install(TARGETS interpreter_backend - RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL - LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL) endif()