-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
129 lines (111 loc) · 2.98 KB
/
CMakeLists.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
cmake_minimum_required(VERSION 3.8)
project(object_detection_openvino)
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
################################################
## Find dependencies ##
################################################
## Find ament macros and libraries
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(tf2 REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(vision_msgs REQUIRED)
find_package(image_transport REQUIRED)
find_package(message_filters REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(Boost REQUIRED)
# Ngraph and InferenceEngine
find_package(ngraph REQUIRED)
find_package(InferenceEngine 2021.4.1 REQUIRED)
if(NOT(InferenceEngine_FOUND))
message(WARNING "InferenceEngine is disabled or not found.")
return()
else()
include_directories(${InferenceEngine_INCLUDE_DIRS}/../samples/cpp/common/)
include_directories(${InferenceEngine_INCLUDE_DIRS}/../samples/cpp/common/utils/include/)
endif()
if(TARGET IE::ie_cpu_extension)
add_definitions(-DWITH_EXTENSIONS)
endif()
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${Boost_INCLUDE_DIRS}
${InferenceEngine_INCLUDE_DIRS}
)
# Set SOURCES
set(SOURCES
src/objectDetectionVPU.cpp
src/openvino.cpp
)
# Executable node
add_executable (${PROJECT_NAME}
${SOURCES}
src/objectDetectionVPU_node.cpp
)
ament_target_dependencies(${PROJECT_NAME}
rclcpp
tf2
std_msgs
sensor_msgs
vision_msgs
image_transport
message_filters
visualization_msgs
cv_bridge
pcl_ros
pcl_conversions
)
# Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}
${InferenceEngine_LIBRARIES}
${NGRAPH_LIBRARIES}
${Boost_LIBRARIES}
)
if(TARGET IE::ie_cpu_extension)
target_link_libraries(${PROJECT_NAME} IE::ie_cpu_extension)
endif()
#############
## Install ##
#############
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION include/${PROJECT_NAME}
FILES_MATCHING PATTERN "*.hpp"
# PATTERN ".svn" EXCLUDE
)
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY models
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY params
DESTINATION share/${PROJECT_NAME}/
)
#############
## Testing ##
#############
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()