-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (62 loc) · 2.01 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
cmake_minimum_required(VERSION 3.1)
project(vision)
file(GLOB_RECURSE sources include/*.h include/*.hpp src/*.cpp src/*.cu)
set(CMAKE_CXX_COMPILIER "/usr/bin/g++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-write-strings")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,$ORIGIN")
#cuda
find_package(CUDA REQUIRED)
message("-- CUDA version:${CUDA_VERSION}")
if(CUDA_VERSION_MAJOR GREATER 9)
message("-- CUDA ${CUDA_VERSION_MAJOR} detected")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-gencode arch=compute_72,code=sm_72
)
endif()
find_package(OpenCV REQUIRED)
if(Opencv_FOUND)
message("found opencv")
endif()
find_package(Threads REQUIRED)
find_package(
catkin REQUIRED COMPONENTS
roscpp
rostime
std_msgs
basketball_msgs
message_generation
geometry_msgs
dynamic_reconfigure
)
add_subdirectory(UsbCapture)
include_directories(
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
/opt/ros/melodic/include
/home/basketballrobot/workspace/src/driver_common-indigo-devel
/home/basketballrobot/workspace/src/driver_common-indigo-devel/driver_base/include/
/home/basketballrobot/workspace/src/hokuyo_node-indigo-devel/include/
/home/basketballrobot/workspace/src/vision/UsbCapture/include/
/home/basketballrobot/workspace/devel/include/
/home/basketballrobot/workspace/devel/include/basketball_msgs/
)
#generate detector lib
cuda_add_library(detector SHARED ${sources})
target_include_directories(detector PRIVATE include/ ${OpenCV_INCLUDE_DIRS} ${CUDA_TOOLKIT_ROOT_DIR}/include ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
target_link_libraries(detector nvinfer nvinfer_plugin nvcaffe_parser gflags "stdc++fs")
add_executable(vision src/main.cpp)
add_dependencies(vision hokuyo_node_gencfg)
target_include_directories(vision PRIVATE include/)
target_link_libraries(
vision detector opencv_highgui opencv_imgproc opencv_core opencv_calib3d opencv_dnn
UsbCapture
${OpenCV_LIBS}
${catkin_LIBRARIES}
libhokuyo
${Boost_LIBRARIES}
Threads::Threads
${PYTHON_LIBRARIES}
)