forked from hku-mars/ROG-Map
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·129 lines (104 loc) · 2.93 KB
/
CMakeLists.txt
File metadata and controls
executable file
·129 lines (104 loc) · 2.93 KB
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.5)
project(rog_map)
set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-O3 -Wall -g -fPIC")
add_compile_options(-DQT_NO_VERSION_TAGGING)
add_compile_options(-Werror=unused-variable)
add_compile_options(-Werror=return-type)
# reduce warning
add_compile_options(-Wno-dev)
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0054 NEW)
set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE BOOL "Suppress developer warnings")
add_definitions(-DROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}/")
# Define the voxelize and raycasting method
add_definitions(-DORIGIN_AT_CORNER)
string(TOUPPER $ENV{ROS_DISTRO} ROS_VERSION)
message(STATUS "ROS version: ${ROS_VERSION}")
message("Using ROS2")
add_definitions(-DUSE_ROS2)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(Eigen3 REQUIRED)
set(includes
include
${Eigen_INCLUDE_DIRS}
# ${OpenCV_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)
set(third_party_libs
# ${OpenCV_LIBRARIES}
${PCL_LIBRARIES}
yaml-cpp
)
set(ros_libs
rclcpp
std_msgs
nav_msgs
geometry_msgs
visualization_msgs
pcl_conversions
tf2_ros
)
include_directories(
${includes}
)
file(GLOB_RECURSE srcs CONFIGURE_DEPENDS src/*.cpp include/*.h include/*.hpp include/*.cpp)
add_library(rog_map STATIC ${srcs})
add_executable(rogmapApp src/rog_map_ros/rogmapApp.cpp)
target_include_directories(rog_map PUBLIC include)
target_link_libraries(rog_map PUBLIC
${THIRD_PARTY})
target_link_libraries(rogmapApp rog_map)
ament_target_dependencies(${PROJECT_NAME} PUBLIC
${ros_libs}
)
target_link_libraries(${PROJECT_NAME} PUBLIC
${third_party_libs}
)
# --- Additions for rog_astar executable ---
add_executable(rogastar App/rogmapApp/src/rog_astar.cpp)
target_include_directories(rogastar PRIVATE App/rogmapApp/include)
# Link against PCL and Eigen (found at the top level)
target_link_libraries(rogastar PRIVATE
${PCL_LIBRARIES}
Eigen3::Eigen
rog_map
)
install(TARGETS
rogastar
DESTINATION lib/${PROJECT_NAME}
)
# --- End of additions ---
install(TARGETS
${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(TARGETS
rogmapApp
DESTINATION lib/${PROJECT_NAME}
)
ament_export_libraries(${PROJECT_NAME}
${third_party_libs}
)
ament_export_include_directories(${includes})
install(DIRECTORY include/
DESTINATION include/
)
install(DIRECTORY launch/
DESTINATION share/${PROJECT_NAME}/launch
)
install(DIRECTORY config/
DESTINATION share/${PROJECT_NAME}/config
)
ament_package()