Files
openvino/cmake/developer_package/plugins/unregister_plugin_cmake.cmake
Mikhail Nosov cf328d299f More fixes of plugins.xml generation (#9942)
* Further fixes of plugins.xml generation
1) Unregistration is done by name (e.g. CPU), not by file name (ov_cpu_plugin)
2) Unregistered line is searched by name="MULTI" instead of just 'MULTI' to not conflict with MULTI_WORK_MODE_AS_AUTO entry
3) Removed list of all possible plugins from ov_runtime as logic shall not rely on this (not possible to add 3rd party plugins)

* Revert ov_runtime - some CI jobs require plugins.xml even though plugins are not built

Registration - if some entry already exists in XML - don't copy it.
E.g.
- Registration of 'TEMPLATE' is performed
- Registration loops through existing plugins.xml
   - If name="TEMPLATE" is found - don't take it to newContent
   - If name like "myCustomPlugin" is found - take it
- As result - "myCustomPlugin" will exist after update, but old "TEMPLATE" will be removed

* Add missing change
2022-01-27 16:54:21 +03:00

36 lines
789 B
CMake

# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
if(NOT EXISTS "${IE_CONFIG_OUTPUT_FILE}")
return()
endif()
# remove plugin file
file(REMOVE "${IE_CONFIGS_DIR}/${IE_PLUGIN_NAME}.xml")
# remove plugin
set(newContent "")
file(STRINGS "${IE_CONFIG_OUTPUT_FILE}" content)
set(skip_plugin OFF)
foreach(line IN LISTS content)
if("${line}" MATCHES "name=\"${IE_PLUGIN_NAME}\"")
set(skip_plugin ON)
endif()
if(NOT skip_plugin)
if(newContent)
set(newContent "${newContent}\n${line}")
else()
set(newContent "${line}")
endif()
endif()
if("${line}" MATCHES "</plugin>")
set(skip_plugin OFF)
endif()
endforeach()
file(WRITE "${IE_CONFIG_OUTPUT_FILE}" "${newContent}")