* Added OpenVINOConfig.cmake * OpenVINOConfig.cmake part 2 * Trying to fix cmake generation * Fixes * Export frontends as well * Fixed condition * Added OpenVINO cmake package usage: docs, C samples * Use more OpenVINO config * Install OpenVINOConfig.cmake * Trying to fix private plugins * Trying to fix .tox * Trying to fix ARM * Fixed samples build * Explicit ngraph duplicated targets * Fixed fuzzing tests build * Added IR frontend installation * Removed install directory for IE reader * Removed IR frontend from export list * Reverted ngraph_DIR * Try to fix .tox * Fixed ieFuncTests with ONNX extensions * Attempt #2 * Trying to fix ngraph setup.py * Fix * Trying to fix ONNX ngraph .tox CI * Trying to remove spaces * Fixed ngraph_DIR -> OpenVINO_DIR * Removed junk files * Try to fix ngraph wheel * Try to fix ie_wheel * Try to fix ngraph wheel
38 lines
1.2 KiB
CMake
38 lines
1.2 KiB
CMake
# Copyright (C) 2018-2021 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# [cmake:extension]
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(TARGET_NAME "template_extension")
|
|
|
|
find_package(OpenVINO REQUIRED COMPONENTS Runtime OPTIONAL_COMPONENTS ONNX)
|
|
find_package(OpenCV QUIET COMPONENTS core)
|
|
|
|
set(SRC cpu_kernel.cpp extension.cpp op.cpp)
|
|
|
|
if(OpenCV_FOUND)
|
|
set(SRC ${SRC} fft_kernel.cpp fft_op.cpp)
|
|
endif()
|
|
|
|
add_library(${TARGET_NAME} MODULE ${SRC})
|
|
|
|
if(OpenCV_FOUND)
|
|
target_compile_definitions(${TARGET_NAME} PRIVATE OPENCV_IMPORT_ENABLED)
|
|
target_link_libraries(${TARGET_NAME} PRIVATE opencv_core)
|
|
endif()
|
|
|
|
target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_EXTENSION_API)
|
|
target_link_libraries(${TARGET_NAME} PRIVATE openvino::core openvino::runtime)
|
|
|
|
if(OpenVINO_Frontend_ONNX_FOUND)
|
|
target_link_libraries(${TARGET_NAME} PRIVATE openvino::frontend::onnx)
|
|
target_compile_definitions(${TARGET_NAME} PRIVATE OPENVINO_ONNX_FRONTEND_ENABLED)
|
|
endif()
|
|
# [cmake:extension]
|
|
|
|
# Enable code style check
|
|
file(GLOB_RECURSE template_extension_src "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
|
|
add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${template_extension_src})
|