forked from FangGet/BundleFusion_Ubuntu_Pangolin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
111 lines (94 loc) · 3.07 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
cmake_minimum_required(VERSION 3.0)
project(BundleFusion)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -pthread -lrt -fPIC")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
option(VISUALIZATION "Build BundleFusion With Pangolin" ON)
find_package(CUDA REQUIRED)
set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
set(CUDA_NVCC_FLAGS -arch=sm_35;-std=c++11;-lm)
ADD_DEFINITIONS(-fpermissive)
find_package (Threads)
find_package (Eigen3 REQUIRED)
find_package (OpenCV REQUIRED)
file(GLOB_RECURSE cpp_file src/*.cpp)
file(GLOB_RECURSE cu_file src/*.cu)
if(VISUALIZATION)
find_package(Pangolin 0.2 QUIET)
message("-- found PANGOLIN, add visualization plug.")
if(Pangolin_FOUND)
find_package(Boost COMPONENTS system thread)
add_definitions(-DWITH_VISUALIZATION)
include_directories(
${Pangolin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include/Visualization/
)
endif()
else()
message("-- not found PANGOLIN, visualization not enable.")
file(GLOB_RECURSE Visualization_CPP_Files src/PangolinOutputWrapper.cpp)
file(GLOB_RECURSE Visualization_CU_Files src/PangolinOutputWrapper.cu)
list(REMOVE_ITEM cpp_file ${Visualization_CPP_Files})
list(REMOVE_ITEM cu_file ${Visualization_CU_Files})
endif()
include_directories(
${CUDA_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/include/
${PROJECT_SOURCE_DIR}/include/mLib/include
${PROJECT_SOURCE_DIR}/include/mLibExternal
${PROJECT_SOURCE_DIR}/include/cutil/cutil/inc/
${PROJECT_SOURCE_DIR}/include/FreeImage/
${PROJECT_SOURCE_DIR}/include/interface/
${PROJECT_SOURCE_DIR}/include/DepthSensing/
${PROJECT_SOURCE_DIR}/include/SiftGPU/
${PROJECT_SOURCE_DIR}/include/Solver/
)
cuda_add_library(BundleFusion SHARED
${cu_file}
${cpp_file}
)
target_link_libraries(BundleFusion
cuda
freeimage
${CUDA_LIBRARIES}
${OpenCV_LIBS}
)
if(Pangolin_FOUND)
target_link_libraries(BundleFusion
${Pangolin_LIBRARIES}
boost_system
boost_thread
)
endif()
# install(EXPORT gputsdfrecon-targets
# NAMESPACE gputsdfrecon::
# FILE gputsdfrecon-config.cmake
# DESTINATION lib/cmake/gputsdfrecon)
add_executable(bundle_fusion_example example/bundle_fusion_example.cpp)
target_link_libraries(bundle_fusion_example
BundleFusion
)
#
# include_directories(
# ${PROJECT_SOURCE_DIR}/example/include/)
#
# add_executable(example_depthfusion example/example_depthfusion.cpp example/native.cpp)
# target_link_libraries(example_depthfusion
# gpu_tsdf_bf
# )
#
# add_executable(example_rkd_fusion example/example_rkd_fusion.cpp example/native.cpp)
# target_link_libraries(example_rkd_fusion gpu_tsdf_bf)
#
# add_executable(example_rkd_fusion_cd example/example_rkd_fusion_cd.cpp example/native.cpp)
#
# target_link_libraries(example_rkd_fusion_cd gpu_tsdf_bf)
#add_executable(example_tsdf_integrate_orbslam example/example_orbslam_tsdf_integrate.cpp)
#target_link_libraries(example_tsdf_integrate_orbslam
# gpu_tsdf_bf
# )