-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
executable file
·193 lines (151 loc) · 4.5 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
cmake_minimum_required(VERSION 3.0.0)
project(dynamap VERSION 0.1.0)
add_compile_options(-std=c++11)
## Debugging things vs Release Optimizations
## Set flags for each mode
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wdeprecated-declarations")
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES ")
# set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
# set(CMAKE_CXX_FLAGS_RELEASE "-O3")
## Default to release if not specified
# cmake .. -DCMAKE_BUILD_TYPE=Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
message("Build type: ${CMAKE_BUILD_TYPE}")
## Type dependent definitions
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
add_definitions(-DDEBUG_MODE)
endif()
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system signals)
find_package(catkin REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenCV REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Eigen3 3.3.7 REQUIRED)
find_package(catkin COMPONENTS
message_generation
genmsg
roscpp
sensor_msgs
std_msgs
pcl_ros
cv_bridge
message_filters
)
catkin_package(
CATKIN_DEPENDS
std_msgs
message_runtime
sensor_msgs
DEPENDS
Boost
)
# // to fix conflict of PCL and cuda
get_directory_property(dir_defs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
set(vtk_flags)
foreach(it ${dir_defs})
if(it MATCHES "vtk*")
list(APPEND vtk_flags ${it})
endif()
endforeach()
foreach(d ${vtk_flags})
remove_definitions(-D${d})
endforeach()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
include_directories(
include
${catkin_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${projection_example_INCLUDE_DIRS}
include/dataStructure
include/dataStructure/heap
include/dataStructure/kdtree
include/dataStructure/hashTable
include/image
include/image/sensor
include/image/kernel2D
include/image/conv2D
include/image/pyramid
include/builder
include/solver
# include/solver/icpSVD
include/solver/gnSolver
include/solver/nonRigidICP
include/math
include/blender
include/geometry
include/geometry/tsdf
include/geometry/mesh
include/geometry/defGraph
include/geometry/raytracing
include/geometry/marchingCubes
include/geometry/mesh/meshExtractor
include/utils
)
## Declare a cpp library
add_library(
${PROJECT_NAME}_core
include/utils/utils_String.cpp
include/utils/utils_Dataset.cpp
include/geometry/mesh/mesh_IO.cpp
# include/nodehandler/nodehandler.cpp
)
target_link_libraries(
${PROJECT_NAME}_core
${catkin_LIBRARIES}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${OpenCV_LIBS}
${PCL_LIBRARIES}
${Boost_LIBRARIES}
Eigen3::Eigen
)
add_subdirectory(include/gui)
set(CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --ptxas-options=-v")
SET(CUDA_NVCC_FLAGS "-arch=sm_50" CACHE STRING "nvcc flags" FORCE)
SET(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE)
# SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3;-std=c++11 -gencode arch=compute_50,code=sm_50)
SET(LIB_TYPE STATIC)
CUDA_ADD_LIBRARY(${PROJECT_NAME}_cuda
${LIB_TYPE}
# include/geometry/knn/knn.cu
include/geometry/tsdf/tsdf.cu
include/geometry/mesh/mesh.cu
include/geometry/mesh/meshSTD.cu
include/geometry/defGraph/defGraph.cu
include/geometry/rayTracing/rayTracing.cu
include/geometry/mesh/meshExtractor/meshExtractor.cu
include/blender/dqBlender/dqBlender.cu
include/geometry/marchingCubes/marchingCubes.cu
include/image/conv2D/conv2D.cu
include/image/pyramid/pyramid.cu
include/image/sensor/rgbdImage.cu
include/image/kernel2D/kernel2D.cu
include/solver/nonRigidICP/nonRigidICP.cu
include/solver/gnSolver/gnSolver.cu
include/builder/builder.cu
include/dataStructure/heap/heap.cu
include/dataStructure/kdtree/kdtree.cu
include/dataStructure/hashTable/hashTable.cu
# include/utils/utils_Cuda.cu
)
target_link_libraries(${PROJECT_NAME}_cuda
${PROJECT_NAME}_gui
-lcublas
-lcurand
-lcusparse
-lcusolver
)
add_subdirectory(src)
add_subdirectory(src/test)