-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·120 lines (100 loc) · 2.73 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
cmake_minimum_required(VERSION 3.0.2)
project(xyw_lidar_test)
add_definitions(-DPROJECT_PATH="${PROJECT_SOURCE_DIR}")
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++14)
# SET(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_RELEASE "-Og -pthread -march=native -Wunknown-pragmas")
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib # for ros/package.h
sensor_msgs
geometry_msgs
nav_msgs
message_generation
std_msgs
visualization_msgs
dynamic_reconfigure
eigen_conversions
# nlink_example
tf2
tf2_ros
tf2_geometry_msgs
pcl_conversions
)
# dynamic reconfigure
generate_dynamic_reconfigure_options(
cfg/XYWLidarTest.cfg
)
find_package(PCL)
#GLOG (neccessary)
FIND_PACKAGE(GLOG REQUIRED QUIET)
IF(GLOG_FOUND)
INCLUDE_DIRECTORIES(${GLOG_INCLUDE_DIRS})
MESSAGE("GLOG [OK]:" ${GLOG_INCLUDE_DIRS})
ENDIF(GLOG_FOUND)
# OpenMP
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
# Ceres
FIND_PACKAGE(Ceres REQUIRED QUIET)
IF(Ceres_FOUND)
INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})
MESSAGE("CERES [OK]:" ${CERES_INCLUDE_DIRS})
ADD_DEFINITIONS(-DCERES_ON)
ENDIF(Ceres_FOUND)
add_message_files(
FILES
people_item.msg
people_list.msg
)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
geometry_msgs
)
catkin_package(
INCLUDE_DIRS include
DEPENDS PCL
dynamic_reconfigure
# LIBRARIES xyw_lidar_test
# CATKIN_DEPENDS roscpp sensor_msgs std_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
include_directories(
# include
${catkin_INCLUDE_DIRS}
include
${PCL_INCLUDE_DIRS}
)
link_directories(
${PCL_LIBRARY_DIRS}
)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/xyw_lidar_test.cpp
# )
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(${PROJECT_NAME}_node src/main.cpp)
add_dependencies(${PROJECT_NAME}_node ${PROJECT_NAME}_gencfg)
add_executable(classTest src/classTest.cpp)
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
SET(DEP_LIBS ${DEP_LIBS} ${PCL_LIBRARIES})
SET(DEP_LIBS ${DEP_LIBS} ${catkin_LIBRARIES})
SET(DEP_LIBS ${DEP_LIBS} ${GLOG_LIBRARIES})
SET(DEP_LIBS ${DEP_LIBS} ${CERES_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_node
${DEP_LIBS}
)