diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 6847c7162a4bc0..498f6171fddd88 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -95,7 +95,6 @@ if(THREADING STREQUAL "OMP") install(FILES ${source_list} DESTINATION "deployment_tools/inference_engine/external/omp/lib" COMPONENT omp) - endif() ## TBB package diff --git a/cmake/developer_package/add_ie_target.cmake b/cmake/developer_package/add_ie_target.cmake index d49f16a4db0e49..6ae2ce47981f94 100644 --- a/cmake/developer_package/add_ie_target.cmake +++ b/cmake/developer_package/add_ie_target.cmake @@ -159,4 +159,9 @@ function(addIeTargetTest) add_test(NAME ${ARG_NAME} COMMAND ${ARG_NAME}) set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS}) + + install(TARGETS ${ARG_NAME} + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) endfunction() diff --git a/cmake/developer_package/packaging.cmake b/cmake/developer_package/packaging.cmake index 2b5e945b17af54..fd7d39a35ec53d 100644 --- a/cmake/developer_package/packaging.cmake +++ b/cmake/developer_package/packaging.cmake @@ -2,16 +2,15 @@ # SPDX-License-Identifier: Apache-2.0 # +include(CMakeParseArguments) include(CPackComponent) -unset(IE_CPACK_COMPONENTS_ALL CACHE) - -set(IE_CPACK_IE_DIR deployment_tools/inference_engine) # # ie_cpack_set_library_dir() # # Set library directory for cpack # +set(IE_CPACK_IE_DIR deployment_tools/inference_engine) function(ie_cpack_set_library_dir) if(WIN32) set(IE_CPACK_LIBRARY_PATH ${IE_CPACK_IE_DIR}/lib/${ARCH_FOLDER}/${CMAKE_BUILD_TYPE} PARENT_SCOPE) @@ -31,25 +30,44 @@ ie_cpack_set_library_dir() # # Wraps original `cpack_add_component` and adds component to internal IE list # +unset(IE_CPACK_COMPONENTS_ALL CACHE) macro(ie_cpack_add_component NAME) list(APPEND IE_CPACK_COMPONENTS_ALL ${NAME}) set(IE_CPACK_COMPONENTS_ALL "${IE_CPACK_COMPONENTS_ALL}" CACHE STRING "" FORCE) - cpack_add_component(${NAME} ${ARGN}) + + cpack_add_component(${NAME} ${args}) endmacro() +# create test component +if(ENABLE_TESTS) + cpack_add_component(tests DISABLED) +endif() + macro(ie_cpack) set(CPACK_GENERATOR "TGZ") + set(CPACK_SOURCE_GENERATOR "") + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenVINO toolkit") + set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED OFF) + set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) # multiple components + set(CPACK_PACKAGE_VENDOR "Intel Corporation") + set(CPACK_VERBATIM_VARIABLES ON) + set(CPACK_COMPONENTS_ALL ${ARGN}) + set(CPACK_STRIP_FILES ON) + set(CPACK_THREADS 8) + string(REPLACE "/" "_" CPACK_PACKAGE_VERSION "${CI_BUILD_NUMBER}") if(WIN32) set(CPACK_PACKAGE_NAME inference-engine_${CMAKE_BUILD_TYPE}) else() set(CPACK_PACKAGE_NAME inference-engine) endif() - set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - set(CPACK_PACKAGE_VENDOR "Intel") - set(CPACK_COMPONENTS_ALL ${ARGN}) - set(CPACK_STRIP_FILES ON) + + foreach(ver IN LISTS MAJOR MINOR PATCH) + if(DEFINED IE_VERSION_${ver}) + set(CPACK_PACKAGE_VERSION_${ver} ${IE_VERSION_${ver}}) + endif() + endforeach() if(OS_FOLDER) set(CPACK_SYSTEM_NAME "${OS_FOLDER}") diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 8d3d3c750d7b98..ec421ad8f6a932 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -25,23 +25,33 @@ if(NOT ENABLE_DOCKER) set(InferenceEngine_DIR ${CMAKE_BINARY_DIR}) endif() - if (NGRAPH_ONNX_IMPORT_ENABLE) + if(NGRAPH_ONNX_IMPORT_ENABLE) add_subdirectory(onnx_custom_op) endif() add_subdirectory(template_extension) set(all_docs_targets ie_docs_snippets - template_extension - templatePlugin TemplateBehaviorTests TemplateFunctionalTests) + template_extension templatePlugin templateFuncTests) foreach(target_name IN LISTS all_docs_targets) - if (TARGET ${target_name}) + if(TARGET ${target_name}) set_target_properties(${target_name} PROPERTIES FOLDER docs) if(WIN32) set_target_properties(${target_name} PROPERTIES COMPILE_PDB_NAME ${target_name}) endif() endif() endforeach() + + # install + + set(install_targets template_extension) + if(ENABLE_TEMPLATE_PLUGIN) + list(APPEND install_targets templatePlugin templateFuncTests) + endif() + + install(TARGETS ${install_targets} + RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) endif() set(LINKCHECKER_PY "" CACHE FILEPATH "Path to linkchecker.py for documentation check") diff --git a/docs/template_plugin/src/CMakeLists.txt b/docs/template_plugin/src/CMakeLists.txt index 799a2c76c48ed3..4d1144e6a00921 100644 --- a/docs/template_plugin/src/CMakeLists.txt +++ b/docs/template_plugin/src/CMakeLists.txt @@ -50,6 +50,5 @@ endif() # install(TARGETS ${TARGET_NAME} # RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} -# ARCHIVE DESTINATION ${IE_CPACK_ARCHIVE_PATH} # LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} # COMPONENT ${component_name}) diff --git a/inference-engine/cmake/vpu_dependencies.cmake b/inference-engine/cmake/vpu_dependencies.cmake index 74d121399f0d78..9fe7f2b7ce87b7 100644 --- a/inference-engine/cmake/vpu_dependencies.cmake +++ b/inference-engine/cmake/vpu_dependencies.cmake @@ -81,8 +81,8 @@ foreach(firmware_name IN LISTS VPU_SUPPORTED_FIRMWARES) VERBATIM) install(FILES ${${var_name}} - DESTINATION ${IE_CPACK_RUNTIME_PATH} - COMPONENT myriad) + DESTINATION ${IE_CPACK_RUNTIME_PATH} + COMPONENT myriad) endforeach() add_custom_target(vpu_copy_firmware diff --git a/inference-engine/src/inference_engine/CMakeLists.txt b/inference-engine/src/inference_engine/CMakeLists.txt index 6dc5c651a35cbc..2109ff5749b80b 100644 --- a/inference-engine/src/inference_engine/CMakeLists.txt +++ b/inference-engine/src/inference_engine/CMakeLists.txt @@ -273,6 +273,12 @@ install(FILES $/plugins.xml DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core) +# for InferenceEngineUnitTest +install(FILES $/plugins.xml + DESTINATION tests/lib + COMPONENT tests + EXCLUDE_FROM_ALL) + # Install cmake scripts install(EXPORT InferenceEngineTargets diff --git a/inference-engine/src/readers/ir_reader_v7/CMakeLists.txt b/inference-engine/src/readers/ir_reader_v7/CMakeLists.txt index a9323fefaa12d7..d03f642171b357 100644 --- a/inference-engine/src/readers/ir_reader_v7/CMakeLists.txt +++ b/inference-engine/src/readers/ir_reader_v7/CMakeLists.txt @@ -45,3 +45,13 @@ endif() # code style add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}) + +# for ieFuncTests +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) + +# for InferenceEngineUnitTest +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/inference-engine/src/snippets/CMakeLists.txt b/inference-engine/src/snippets/CMakeLists.txt index 2fc29be7096ffd..6cdb23654e7db3 100644 --- a/inference-engine/src/snippets/CMakeLists.txt +++ b/inference-engine/src/snippets/CMakeLists.txt @@ -56,3 +56,8 @@ openvino_developer_export_targets(COMPONENT inference_engine TARGETS ${TARGET_NA # install(TARGETS ${TARGET_NAME} # RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT core # LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT core) + +# TODO: remove once install commands above are commented out +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/CMakeLists.txt b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/CMakeLists.txt index e4f055b2ee451a..1c3fb266cc2cea 100644 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/CMakeLists.txt +++ b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/CMakeLists.txt @@ -38,3 +38,7 @@ endif() target_link_libraries(${TARGET_NAME} PRIVATE inference_engine) target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN) + +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION ${IE_CPACK_RUNTIME_PATH} COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${IE_CPACK_LIBRARY_PATH} COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/inference-engine/tests_deprecated/behavior/vpu/CMakeLists.txt b/inference-engine/tests_deprecated/behavior/vpu/CMakeLists.txt index 1ad61350dbdb55..c1f7d8c0f2b40a 100644 --- a/inference-engine/tests_deprecated/behavior/vpu/CMakeLists.txt +++ b/inference-engine/tests_deprecated/behavior/vpu/CMakeLists.txt @@ -68,6 +68,11 @@ function(enable_vpu TARGET_NAME FLAG_NAME PLUGIN_NAME) add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME}) set_property(TEST ${TARGET_NAME} PROPERTY LABELS VPU MYRIAD) + install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) + add_dependencies(${TARGET_NAME} ${DEPENDENCIES}) endfunction(enable_vpu) diff --git a/inference-engine/tests_deprecated/fluid_preproc/CMakeLists.txt b/inference-engine/tests_deprecated/fluid_preproc/CMakeLists.txt index fd78ef95636b9e..703d9085c82408 100644 --- a/inference-engine/tests_deprecated/fluid_preproc/CMakeLists.txt +++ b/inference-engine/tests_deprecated/fluid_preproc/CMakeLists.txt @@ -34,3 +34,8 @@ endif() add_test(NAME ${TARGET} COMMAND ${TARGET}) set_property(TEST ${TARGET} PROPERTY LABELS IE PREPROC) + +install(TARGETS ${TARGET} + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) diff --git a/inference-engine/tests_deprecated/functional/gna/CMakeLists.txt b/inference-engine/tests_deprecated/functional/gna/CMakeLists.txt index 564504b5f78ba8..857e65b839483f 100644 --- a/inference-engine/tests_deprecated/functional/gna/CMakeLists.txt +++ b/inference-engine/tests_deprecated/functional/gna/CMakeLists.txt @@ -53,6 +53,11 @@ add_dependencies(${TARGET_NAME} ${DEPENDENCIES}) add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME}) set_property(TEST ${TARGET_NAME} PROPERTY LABELS GNA) +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) + if(GNA_LIBRARY_VERSION STREQUAL "GNA1") target_compile_definitions(${TARGET_NAME} PRIVATE GNA1_LIB) endif() diff --git a/inference-engine/tests_deprecated/unit/CMakeLists.txt b/inference-engine/tests_deprecated/unit/CMakeLists.txt index c222e01f2b30b3..53de37c780c8c0 100644 --- a/inference-engine/tests_deprecated/unit/CMakeLists.txt +++ b/inference-engine/tests_deprecated/unit/CMakeLists.txt @@ -125,4 +125,9 @@ endif() add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME}) set_property(TEST ${TARGET_NAME} PROPERTY LABELS IE) +install(TARGETS ${TARGET_NAME} + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) + add_dependencies(${TARGET_NAME} mock_engine) diff --git a/inference-engine/tests_deprecated/unit/engines/gna/gna_matcher.cpp b/inference-engine/tests_deprecated/unit/engines/gna/gna_matcher.cpp index 7b328aa9e97c49..2cc7c23634a63a 100644 --- a/inference-engine/tests_deprecated/unit/engines/gna/gna_matcher.cpp +++ b/inference-engine/tests_deprecated/unit/engines/gna/gna_matcher.cpp @@ -113,12 +113,12 @@ void GNAPropagateMatcher :: match() { OutputsDataMap outputsInfo; auto loadNetworkFromIR = [&] () -> InferenceEngine::CNNNetwork { - Core net_reader; + Core core; auto weights_fake = make_shared_blob(TensorDesc(Precision::U8, SizeVector({std::numeric_limits::max()/2}), Layout::C)); weights_fake->allocate(); - auto net_original = net_reader.ReadNetwork(_env.model, weights_fake); + auto net_original = core.ReadNetwork(_env.model, weights_fake); size_t weightsSize = 0; std::vector dataBlobs = { "weights", @@ -157,7 +157,7 @@ void GNAPropagateMatcher :: match() { fillWeights(weights); } - auto net = net_reader.ReadNetwork(_env.model, weights); + auto net = core.ReadNetwork(_env.model, weights); sortedLayers = details::CNNNetSortTopologically(net); sortedLayers.insert(sortedLayers.end(), tiBodies.begin(), tiBodies.end()); diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index d3e571b4ea186d..fda841e2142e9b 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -631,6 +631,11 @@ if (NGRAPH_INTERPRETER_ENABLE) target_link_libraries(unit-test PRIVATE interpreter_backend) endif() +install(TARGETS unit-test + RUNTIME DESTINATION tests + COMPONENT tests + EXCLUDE_FROM_ALL) + ############ FRONTEND ############ target_include_directories(unit-test PRIVATE ${FRONTEND_INCLUDE_PATH}) target_link_libraries(unit-test PRIVATE frontend_manager) diff --git a/ngraph/test/frontend/CMakeLists.txt b/ngraph/test/frontend/CMakeLists.txt index 98f4095b37c5b5..0b0c70564fd51f 100644 --- a/ngraph/test/frontend/CMakeLists.txt +++ b/ngraph/test/frontend/CMakeLists.txt @@ -14,3 +14,7 @@ target_link_libraries(mock1_ngraph_frontend PRIVATE frontend_manager) add_dependencies(unit-test mock1_ngraph_frontend) add_clang_format_target(mock1_ngraph_frontend_clang FOR_TARGETS mock1_ngraph_frontend) + +install(TARGETS mock1_ngraph_frontend + RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/ngraph/test/runtime/CMakeLists.txt b/ngraph/test/runtime/CMakeLists.txt index be84499ee0e636..ed741cfdc04a94 100644 --- a/ngraph/test/runtime/CMakeLists.txt +++ b/ngraph/test/runtime/CMakeLists.txt @@ -64,5 +64,9 @@ if (NOT WIN32) endif() target_include_directories(ngraph_backend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +install(TARGETS ngraph_backend + RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) + add_subdirectory(interpreter) add_subdirectory(ie) diff --git a/ngraph/test/runtime/ie/CMakeLists.txt b/ngraph/test/runtime/ie/CMakeLists.txt index 05b5d10b6362fd..43c38286249373 100644 --- a/ngraph/test/runtime/ie/CMakeLists.txt +++ b/ngraph/test/runtime/ie/CMakeLists.txt @@ -28,3 +28,7 @@ endif() add_dependencies(ie_backend inference_engine) target_include_directories(ie_backend PUBLIC ${IE_MAIN_SOURCE_DIR}/include) target_link_libraries(ie_backend PUBLIC ngraph_backend inference_engine) + +install(TARGETS ie_backend + RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL) diff --git a/ngraph/test/runtime/interpreter/CMakeLists.txt b/ngraph/test/runtime/interpreter/CMakeLists.txt index e910458d48d780..8babddcc9f2415 100644 --- a/ngraph/test/runtime/interpreter/CMakeLists.txt +++ b/ngraph/test/runtime/interpreter/CMakeLists.txt @@ -23,4 +23,8 @@ if (NGRAPH_INTERPRETER_ENABLE) target_compile_definitions(interpreter_backend PRIVATE INTERPRETER_BACKEND_EXPORTS) target_link_libraries(interpreter_backend PUBLIC ngraph_backend) + + install(TARGETS interpreter_backend + RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL + LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT tests EXCLUDE_FROM_ALL) endif()