forked from koide3/fast_gicp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
130 lines (115 loc) · 3.33 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
cmake_minimum_required(VERSION 3.10.0)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 61)
endif()
project(fast_gicp LANGUAGES CXX CUDA)
option(BUILD_VGICP_CUDA "Build GPU-powered VGICP" ON)
option(BUILD_apps "Build application programs" ON)
option(BUILD_test "Build test programs" OFF)
option(BUILD_PYTHON_BINDINGS "Build python bindings" OFF)
set(CMAKE_BUILD_TYPE "Release")
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
add_definitions(${PCL_DEFINITIONS})
include(FetchContent)
FetchContent_Declare(
Thrust
GIT_REPOSITORY https://github.com/NVIDIA/thrust.git
GIT_TAG 1.17.2
)
FetchContent_MakeAvailable(Thrust)
thrust_create_target(Thrust)
###########
## Build ##
###########
glyd_add_library(fast_gicp SHARED
SOURCES
src/fast_gicp/gicp/lsq_registration.cpp
#src/fast_gicp/gicp/fast_gicp.cpp
#src/fast_gicp/gicp/fast_gicp_st.cpp
#src/fast_gicp/gicp/fast_vgicp.cpp
src/fast_gicp/gicp/fast_vgicp_cuda.cpp
src/fast_gicp/ndt/ndt_cuda.cpp
LIBRARIES
pcl::pcl_common
pcl::pcl_features
pcl::pcl_filters
pcl::pcl_io
pcl::pcl_kdtree
pcl::pcl_octree
pcl::pcl_registration
pcl::pcl_sample_consensus
pcl::pcl_search
fast_vgicp_cuda
#COMPILE_OPTIONS
# ${OpenMP_CXX_FLAGS}
)
target_include_directories(fast_gicp PUBLIC
include
)
### CUDA ###
if(BUILD_VGICP_CUDA)
set(CUDA_NVCC_FLAGS "--expt-relaxed-constexpr")
add_definitions(-DUSE_VGICP_CUDA)
glyd_add_library(fast_vgicp_cuda SHARED
SOURCES
src/fast_gicp/cuda/fast_vgicp_cuda.cu
src/fast_gicp/cuda/brute_force_knn.cu
src/fast_gicp/cuda/covariance_estimation.cu
src/fast_gicp/cuda/covariance_estimation_rbf.cu
src/fast_gicp/cuda/covariance_regularization.cu
src/fast_gicp/cuda/gaussian_voxelmap.cu
src/fast_gicp/cuda/find_voxel_correspondences.cu
src/fast_gicp/cuda/compute_derivatives.cu
src/fast_gicp/cuda/compute_mahalanobis.cu
src/fast_gicp/cuda/ndt_cuda.cu
src/fast_gicp/cuda/ndt_compute_derivatives.cu
LIBRARIES
pcl::pcl_common
pcl::pcl_features
pcl::pcl_filters
pcl::pcl_io
pcl::pcl_kdtree
pcl::pcl_octree
pcl::pcl_registration
pcl::pcl_sample_consensus
pcl::pcl_search
Eigen3::Eigen
Thrust
CUDA::cublas
CUDA::curand
)
set_property(
TARGET
fast_vgicp_cuda
PROPERTY
CUDA_STANDARD
14
)
set_target_properties(fast_vgicp_cuda PROPERTIES CUDA_ARCHITECTURES "61;72;86;87")
target_include_directories(fast_vgicp_cuda PRIVATE
include
thirdparty/nvbio
# ${OpenMP_CXX_FLAGS}
)
endif()
### APPS ###
if(BUILD_apps)
glyd_add_executable(
gicp_align
SOURCES
src/align.cpp
LIBRARIES
fast_gicp
pcl::pcl_common
pcl::pcl_features
pcl::pcl_filters
pcl::pcl_io
pcl::pcl_kdtree
pcl::pcl_octree
pcl::pcl_registration
pcl::pcl_sample_consensus
# COMPILE_OPTIONS
# ${OpenMP_CXX_FLAGS}
)
endif()