-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·90 lines (77 loc) · 1.89 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
cmake_minimum_required(VERSION 3.5)
project(object_detector)
# set compilation
# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} -O3")
# useful macros
# include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/util.cmake)
# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
# find dependencies
#find_package(Glog REQUIRED)
find_package(Threads)
find_package(OpenCV 4 REQUIRED)
# ROS
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
roscpp
usfs_common
usfs_inference
usfs_example
usfs_bridge
platform_driver
DEPENDS)
find_package(catkin
REQUIRED
COMPONENTS
std_msgs
roscpp
usfs_common
usfs_inference
usfs_example
usfs_bridge
cv_bridge
image_transport
pcl_ros
platform_driver
)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(Eigen3 REQUIRED)
include_directories(${Eigen3_INCLUDE_DIRS})
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
# common include directories
include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
${PCL_DEFINITIONS}
)
# find all source files
# file(GLOB_RECURSE
# src_files
# ${PROJECT_SOURCE_DIR}/src/*.cc
# ${PROJECT_SOURCE_DIR}/src/*/*.cc
# )
# common library
# add_library(
# ${PROJECT_NAME}
# SHARED
# ${src_files}
# )
# target_link_libraries(
# ${PROJECT_NAME}
# ${GLOG_LIBRARIES}
# ${catkin_LIBRARIES}
# Threads::Threads
# ${OpenCV_LIBS}
# )
add_executable(detector src/detector.cpp)
target_link_libraries(detector ${PCL_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_INCLUDE_DIRS} ${OpenCV_LIBS})