-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
Copy pathCMakeLists.txt
202 lines (178 loc) · 7.42 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
set(SUBSYS_NAME visualization)
set(SUBSYS_DESC "Point cloud visualization library")
set(SUBSYS_DEPS common io kdtree geometry search)
if(NOT VTK_FOUND)
set(DEFAULT FALSE)
set(REASON "VTK was not found.")
else(NOT VTK_FOUND)
set(DEFAULT TRUE)
set(REASON)
set(VTK_USE_FILE "${VTK_USE_FILE}" CACHE INTERNAL "VTK_USE_FILE")
include("${VTK_USE_FILE}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
endif(NOT VTK_FOUND)
PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ${DEFAULT} "${REASON}")
PCL_SUBSYS_DEPEND(build "${SUBSYS_NAME}" DEPS ${SUBSYS_DEPS} EXT_DEPS vtk OPT_DEPS openni openni2 ensenso davidSDK dssdk rssdk)
if (ANDROID)
set (build FALSE)
message("VTK was found, but cannot be compiled for Android. Please use VES instead.")
endif ()
if (OPENGL_FOUND)
if(OPENGL_INCLUDE_DIR)
include_directories("${OPENGL_INCLUDE_DIR}")
endif()
if(OPENGL_DEFINITIONS)
add_definitions("${OPENGL_DEFINITIONS}")
endif()
endif()
PCL_ADD_DOC("${SUBSYS_NAME}")
if(build)
set(srcs
src/point_picking_event.cpp
src/interactor_style.cpp
src/point_cloud_handlers.cpp
src/pcl_visualizer.cpp
src/histogram_visualizer.cpp
src/common/common.cpp
src/common/io.cpp
src/common/shapes.cpp
src/common/ren_win_interact_map.cpp
src/cloud_viewer.cpp
src/image_viewer.cpp
src/window.cpp
src/range_image_visualizer.cpp
src/common/float_image_utils.cpp
src/vtk/pcl_image_canvas_source_2d.cpp
src/vtk/pcl_context_item.cpp
src/vtk/vtkRenderWindowInteractorFix.cpp
)
if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_LESS "5.6")
# A custom interactor is necessary on VTK 5.4 and below
list(APPEND srcs src/interactor.cpp)
endif("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_LESS "5.6")
if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
# PCLPainter2D uses some functions not present in vtk 5.6
list(APPEND srcs
src/pcl_painter2D.cpp
src/pcl_plotter.cpp
)
endif("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
if(VTK_RENDERING_BACKEND_OPENGL_VERSION VERSION_LESS 2)
list(APPEND srcs
"src/vtk/vtkVertexBufferObject.cxx"
"src/vtk/vtkVertexBufferObjectMapper.cxx"
)
endif()
set(incs
"include/pcl/${SUBSYS_NAME}/eigen.h"
"include/pcl/${SUBSYS_NAME}/boost.h"
"include/pcl/${SUBSYS_NAME}/cloud_viewer.h"
"include/pcl/${SUBSYS_NAME}/histogram_visualizer.h"
"include/pcl/${SUBSYS_NAME}/image_viewer.h"
"include/pcl/${SUBSYS_NAME}/interactor_style.h"
"include/pcl/${SUBSYS_NAME}/pcl_visualizer.h"
"include/pcl/${SUBSYS_NAME}/pcl_painter2D.h"
"include/pcl/${SUBSYS_NAME}/registration_visualizer.h"
"include/pcl/${SUBSYS_NAME}/point_cloud_handlers.h"
"include/pcl/${SUBSYS_NAME}/point_cloud_color_handlers.h"
"include/pcl/${SUBSYS_NAME}/point_cloud_geometry_handlers.h"
"include/pcl/${SUBSYS_NAME}/keyboard_event.h"
"include/pcl/${SUBSYS_NAME}/point_picking_event.h"
"include/pcl/${SUBSYS_NAME}/area_picking_event.h"
"include/pcl/${SUBSYS_NAME}/mouse_event.h"
"include/pcl/${SUBSYS_NAME}/window.h"
"include/pcl/${SUBSYS_NAME}/range_image_visualizer.h"
"include/pcl/${SUBSYS_NAME}/interactor.h"
"include/pcl/${SUBSYS_NAME}/vtk.h"
"include/pcl/${SUBSYS_NAME}/simple_buffer_visualizer.h"
)
if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
list(APPEND incs
"include/pcl/${SUBSYS_NAME}/pcl_plotter.h"
)
endif("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
set(common_incs
"include/pcl/${SUBSYS_NAME}/common/actor_map.h"
"include/pcl/${SUBSYS_NAME}/common/common.h"
"include/pcl/${SUBSYS_NAME}/common/io.h"
"include/pcl/${SUBSYS_NAME}/common/ren_win_interact_map.h"
"include/pcl/${SUBSYS_NAME}/common/shapes.h"
"include/pcl/${SUBSYS_NAME}/common/float_image_utils.h"
)
set(impl_incs
"include/pcl/${SUBSYS_NAME}/impl/histogram_visualizer.hpp"
"include/pcl/${SUBSYS_NAME}/impl/pcl_visualizer.hpp"
"include/pcl/${SUBSYS_NAME}/impl/image_viewer.hpp"
"include/pcl/${SUBSYS_NAME}/impl/registration_visualizer.hpp"
"include/pcl/${SUBSYS_NAME}/impl/point_cloud_handlers.hpp"
"include/pcl/${SUBSYS_NAME}/impl/point_cloud_color_handlers.hpp"
"include/pcl/${SUBSYS_NAME}/impl/point_cloud_geometry_handlers.hpp"
)
if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
list(APPEND impl_incs
"include/pcl/${SUBSYS_NAME}/impl/pcl_plotter.hpp"
)
endif("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_GREATER "5.6")
set(common_impl_incs "include/pcl/${SUBSYS_NAME}/common/impl/shapes.hpp"
"include/pcl/${SUBSYS_NAME}/common/impl/common.hpp")
set(vtk_incs
"include/pcl/${SUBSYS_NAME}/vtk/pcl_image_canvas_source_2d.h"
"include/pcl/${SUBSYS_NAME}/vtk/pcl_context_item.h"
"include/pcl/${SUBSYS_NAME}/vtk/vtkRenderWindowInteractorFix.h"
)
if(VTK_RENDERING_BACKEND_OPENGL_VERSION VERSION_LESS 2)
list(APPEND vtk_incs
"include/pcl/${SUBSYS_NAME}/vtk/vtkVertexBufferObject.h"
"include/pcl/${SUBSYS_NAME}/vtk/vtkVertexBufferObjectMapper.h"
)
endif()
# on apple, a workaround is used for the cocoa render window interactor
if(APPLE)
list(APPEND srcs
include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm)
endif()
set(LIB_NAME "pcl_${SUBSYS_NAME}")
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${common_incs} ${impl_incs} ${common_impl_incs} ${vtk_incs})
# apple workaround (continued)
if(APPLE)
target_link_libraries("${LIB_NAME}" "-framework Cocoa")
endif()
if("${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" VERSION_LESS "5.6")
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree vtkCommon vtkWidgets vtkHybrid vtkFiltering vtkRendering ${OPENGL_LIBRARIES})
else()
target_link_libraries("${LIB_NAME}" pcl_common pcl_io pcl_kdtree ${VTK_LIBRARIES} ${OPENGL_LIBRARIES})
endif()
set(EXT_DEPS "")
if(WITH_OPENNI)
list(APPEND EXT_DEPS libopenni)
endif()
if(WITH_OPENNI2)
list(APPEND EXT_DEPS libopenni2)
endif()
if(WITH_ENSENSO)
list(APPEND EXT_DEPS ensenso)
endif()
if(WITH_DAVIDSDK)
list(APPEND EXT_DEPS davidSDK)
endif()
if(WITH_DSSDK)
list(APPEND EXT_DEPS dssdk)
endif()
if(WITH_RSSDK)
list(APPEND EXT_DEPS rssdk)
endif()
PCL_MAKE_PKGCONFIG("${LIB_NAME}" "${SUBSYS_NAME}" "${SUBSYS_DESC}"
"${SUBSYS_DEPS}" "${EXT_DEPS}" "" "" "")
# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/common" ${common_incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/impl" ${impl_incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/common/impl" ${common_impl_incs})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/vtk" ${vtk_incs})
if(BUILD_TESTS)
add_subdirectory(test)
endif(BUILD_TESTS)
if(BUILD_tools)
add_subdirectory(tools)
endif(BUILD_tools)
endif(build)