-
Notifications
You must be signed in to change notification settings - Fork 69
/
CMakeLists.txt
122 lines (110 loc) · 2.26 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
121
122
cmake_minimum_required(VERSION 3.5.1)
project(point_cloud_io)
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-Wall -Wextra -Wpedantic -Werror=return-type)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Options.
option(BUILD_WITH_VTK_SUPPORT "Build package with support for VTK files." OFF)
if(BUILD_WITH_VTK_SUPPORT)
message("point_cloud_io will be built with support for VTK files.")
add_definitions(-DHAVE_VTK)
endif()
set(CATKIN_PACKAGE_DEPENDENCIES
pcl_ros
roscpp
sensor_msgs
)
find_package(catkin REQUIRED
COMPONENTS
${CATKIN_PACKAGE_DEPENDENCIES}
)
catkin_package(
INCLUDE_DIRS
include
CATKIN_DEPENDS
${CATKIN_PACKAGE_DEPENDENCIES}
)
include_directories(
include
SYSTEM
${catkin_INCLUDE_DIRS}
)
###########
## Build ##
###########
add_executable(read
src/read_node.cpp
src/Read.cpp
)
target_link_libraries(read
${catkin_LIBRARIES}
)
add_executable(write
src/write_node.cpp
src/Write.cpp
)
target_link_libraries(write
${catkin_LIBRARIES}
)
#############
## Install ##
#############
install(
TARGETS
read
write
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}
)
install(
DIRECTORY
examples
launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
find_package(cmake_clang_tools QUIET)
if(cmake_clang_tools_FOUND)
add_default_clang_tooling(
TARGETS
read
write
)
endif(cmake_clang_tools_FOUND)
##############
## Test ##
##############
if(CATKIN_ENABLE_TESTING)
catkin_add_gtest(test_${PROJECT_NAME}
test/empty_test.cpp
)
add_dependencies(test_${PROJECT_NAME}
read
write
)
target_include_directories(test_${PROJECT_NAME} PRIVATE
include
)
target_include_directories(test_${PROJECT_NAME} SYSTEM PUBLIC
${catkin_INCLUDE_DIRS}
)
target_link_libraries(test_${PROJECT_NAME}
gtest_main
${catkin_LIBRARIES}
)
###################
## Code_coverage ##
###################
find_package(cmake_code_coverage QUIET)
if(cmake_code_coverage_FOUND)
add_gtest_coverage(
TEST_BUILD_TARGETS
test_${PROJECT_NAME}
)
endif()
endif()