-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
120 lines (106 loc) · 2.94 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
120
cmake_minimum_required(VERSION 3.5.1)
project(geometry_common)
add_compile_options(-std=c++11)
# All warning enabled build option set to ON by default
option(ENABLE_ALL_WARNINGS "Build with all warnings enabled" ON)
if(ENABLE_ALL_WARNINGS)
add_compile_options(-Wall)
endif(ENABLE_ALL_WARNINGS)
# Optimisation flag (O3) build option set to ON by default
option(BUILD_WITH_MAX_OPTIMISATION "Build with -O3 compile option" ON)
if(BUILD_WITH_MAX_OPTIMISATION)
add_compile_options(-O3)
endif(BUILD_WITH_MAX_OPTIMISATION)
find_package(catkin REQUIRED COMPONENTS
tf
std_msgs
sensor_msgs
geometry_msgs
nav_msgs
visualization_msgs
tf2_geometry_msgs
)
catkin_package(
CATKIN_DEPENDS
tf
std_msgs
sensor_msgs
geometry_msgs
nav_msgs
visualization_msgs
tf2_geometry_msgs
INCLUDE_DIRS
include
LIBRARIES
geometry_utils
pointcloud_projector
)
# The documentation build option set to OFF by default
option(BUILD_DOC "Build documentation" OFF)
if(BUILD_DOC)
# check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/doxygen/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# note the option ALL which allows to build the docs together with the application
add_custom_target( doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif(BUILD_DOC)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
# =========
# LIBRARIES
# =========
add_library(geometry_utils
src/Utils.cpp
# data structures
src/Point2D.cpp
src/Point3D.cpp
src/Polygon2D.cpp
src/Polyline2D.cpp
src/Pose2D.cpp
src/XYTheta.cpp
src/Circle.cpp
src/Box2D.cpp
src/Box3D.cpp
src/LineSegment2D.cpp
src/TransformMatrix2D.cpp
src/TransformMatrix3D.cpp
)
target_link_libraries(geometry_utils
)
add_library(pointcloud_projector
src/PointCloudProjector.cpp
)
target_link_libraries(pointcloud_projector
geometry_utils
)
# =====
# TESTS
# =====
if (CATKIN_ENABLE_TESTING)
add_subdirectory(test)
endif ()
# =======
# INSTALL
# =======
install(TARGETS geometry_utils pointcloud_projector
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)