|
| 1 | +# |
| 2 | +# Copyright (C) 2023-2024 Intel Corporation. |
| 3 | +# SPDX-License-Identifier: Apache 2.0 |
| 4 | +# |
| 5 | + |
| 6 | +set(TARGET_NAME protopipe) |
| 7 | + |
| 8 | +if (NOT DEFINED PROJECT_NAME) |
| 9 | + cmake_minimum_required(VERSION 3.13 FATAL_ERROR) |
| 10 | + project(protopipe_standalone) |
| 11 | + include("cmake/standalone.cmake") |
| 12 | + return() |
| 13 | +endif() |
| 14 | + |
| 15 | +# |
| 16 | +# Dependencies |
| 17 | +# |
| 18 | + |
| 19 | +find_package(OpenCV QUIET COMPONENTS gapi) |
| 20 | +if(OpenCV_VERSION VERSION_LESS 4.9) |
| 21 | + message(STATUS "NPU ${TARGET_NAME} tool is disabled due to missing dependencies: gapi from OpenCV >= 4.9.") |
| 22 | + return() |
| 23 | +endif() |
| 24 | + |
| 25 | +if (WIN32) |
| 26 | + # WA: add_tool_target expects to have all dependencies as cmake targets. |
| 27 | + add_library(winmm INTERFACE) |
| 28 | + target_link_libraries(winmm INTERFACE "winmm.lib") |
| 29 | +endif() |
| 30 | + |
| 31 | +# |
| 32 | +# Define the target |
| 33 | +# |
| 34 | + |
| 35 | +set(PROTOPIPE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) |
| 36 | + |
| 37 | +ov_add_target(ADD_CPPLINT |
| 38 | + TYPE EXECUTABLE |
| 39 | + NAME ${TARGET_NAME} |
| 40 | + ROOT ${CMAKE_CURRENT_SOURCE_DIR} |
| 41 | + ADDITIONAL_SOURCE_DIRS ${PROTOPIPE_SOURCE_DIR} |
| 42 | + INCLUDES ${PROTOPIPE_SOURCE_DIR} |
| 43 | + LINK_LIBRARIES |
| 44 | + PRIVATE |
| 45 | + Threads::Threads |
| 46 | + gflags |
| 47 | + yaml-cpp |
| 48 | + openvino::runtime |
| 49 | + opencv_gapi |
| 50 | + winmm) |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +set_target_properties(${TARGET_NAME} PROPERTIES |
| 55 | + FOLDER ${CMAKE_CURRENT_SOURCE_DIR} |
| 56 | + CXX_STANDARD 17) |
| 57 | + |
| 58 | +# |
| 59 | +# Install |
| 60 | +# |
| 61 | + |
| 62 | +install(TARGETS ${TARGET_NAME} |
| 63 | + RUNTIME DESTINATION "tools/${TARGET_NAME}" |
| 64 | + COMPONENT ${NPU_INTERNAL_COMPONENT} |
| 65 | + ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) |
| 66 | + |
| 67 | +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md") |
| 68 | + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" |
| 69 | + DESTINATION "tools/${TARGET_NAME}" |
| 70 | + COMPONENT ${NPU_INTERNAL_COMPONENT} |
| 71 | + ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) |
| 72 | +endif() |
0 commit comments