summaryrefslogtreecommitdiff
path: root/python/openvino/runtime/object_detection_demo/CMakeLists.txt
blob: f88d1d7e9fedf366e5bf750c595e2d685e0d1147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
        set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()

set (TARGET_NAME "object_detection_demo")

file (GLOB MAIN_SRC
    ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)

file (GLOB MAIN_HEADERS
    # Add headers if any
)

source_group("src" FILES ${MAIN_SRC})
source_group("include" FILES ${MAIN_HEADERS})

# Find OpenCV components if exist
find_package(OpenCV COMPONENTS core highgui imgcodecs imgproc videoio REQUIRED)

# Create library file from sources.
add_executable(${TARGET_NAME} ${MAIN_SRC} ${MAIN_HEADERS})

target_include_directories(${TARGET_NAME} PRIVATE
    "$ENV{COREDLA_ROOT}/runtime/common/demo_utils/include/utils"
    "$ENV{COREDLA_ROOT}/runtime/common/monitors/include"
)

if (NOT WIN32)
    set (LIB_DL dl)
endif()

target_link_libraries(${TARGET_NAME}
    openvino::runtime
    openvino_dev_api
    ie_samples_utils
    ${OpenCV_LIBRARIES}
    models
    monitors
    pipelines
    utils
    coreDLAHeteroPlugin
)

if(NOT WIN32)
    target_link_libraries(${TARGET_NAME} ${LIB_DL} pthread)
endif()

set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "\$ORIGIN/../lib")

# For libcoreDlaRuntimePlugin.so - typically specified by $COREDLA_ROOT/runtime/plugins.xml
set_target_properties(${TARGET_NAME} PROPERTIES BUILD_RPATH "\$ORIGIN/..")

install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION "dla/bin" COMPONENT DEMO)
install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION "dla/not_shipped/bin" COMPONENT NOT_SHIPPED)