forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
55 lines (43 loc) · 2.11 KB
/
CMakeLists.txt
File metadata and controls
55 lines (43 loc) · 2.11 KB
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
# Copyright (C) 2018-2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
set(TARGET_NAME openvino_itt)
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp" "include/*.hpp")
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(openvino::itt ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME itt)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::util openvino::shutdown)
if(NOT ENABLE_PROFILING_ITT STREQUAL "OFF")
if(TARGET ittapi::ittnotify)
set(itt_dependency ittapi::ittnotify)
else()
set(itt_dependency ittapi::ittapi)
endif()
target_link_libraries(${TARGET_NAME} PUBLIC ${itt_dependency})
# Ensure the backend is compiled in this target when BASE or FULL
target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT)
# Define profiling mode-specific macros
if(ENABLE_PROFILING_ITT STREQUAL "BASE")
target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT_BASE)
elseif(ENABLE_PROFILING_ITT STREQUAL "FULL")
target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_PROFILING_ITT_FULL)
# Only enable full ITT groups when FULL mode is selected.
if(ENABLE_PROFILING_FILTER STREQUAL "ALL")
target_compile_definitions(${TARGET_NAME} PUBLIC
ENABLE_PROFILING_ALL
ENABLE_PROFILING_FIRST_INFERENCE)
elseif(ENABLE_PROFILING_FILTER STREQUAL "FIRST_INFERENCE")
target_compile_definitions(${TARGET_NAME} PUBLIC
ENABLE_PROFILING_FIRST_INFERENCE)
else()
message(FATAL_ERROR "The ${ENABLE_PROFILING_FILTER} profiling filter isn't supported")
endif()
endif()
endif()
target_include_directories(${TARGET_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
# install & export
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})
ov_developer_package_export_targets(TARGET openvino::itt
INSTALL_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/")