-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (44 loc) · 1.42 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
cmake_minimum_required(VERSION 3.0.2)
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
project(object_detection)
enable_language(CUDA)
set(CMAKE_CXX_COMPILIER "/usr/bin/g++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O3 -Wno-write-strings")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,$ORIGIN")
find_package(CUDA REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
image_transport
camera_info_manager
sensor_msgs
bounding_box_msgs
cv_bridge
std_msgs
)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED)
catkin_package(
DEPENDS
roscpp
image_transport
camera_info_manager
sensor_msgs
image_geometry
std_msgs
)
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
file(GLOB_RECURSE sources modules/*.hpp modules/*.cpp modules/*.h modules/*.cu extra/*.h)
add_library(detector SHARED ${sources})
target_include_directories(detector PRIVATE extra/ modules/ ${OpenCV_INCLUDE_DIRS} ${CUDA_TOOLKIT_ROOT_DIR}/include)
target_link_libraries(detector ${YAML_CPP_LIBRARIES} yaml-cpp nvinfer nvinfer_plugin nvparsers "stdc++fs")
add_executable(object_detector src/object_detection.cpp)
target_include_directories(object_detector PRIVATE modules/ extra/)
target_link_libraries(object_detector detector ${OpenCV_LIBS})
target_link_libraries(object_detector
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)