-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
95 lines (81 loc) · 3.2 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
cmake_minimum_required(VERSION 2.8.3)
project(culling)
## Compile as C++11, supported in ROS Kinetic and newer
#add_compile_options(-std=c++11)
#add_definitions(-std=c++11)
#find_package(octomap REQUIRED)
include("/usr/local/share/octomap/octomap-config.cmake")
find_package(catkin REQUIRED COMPONENTS
roscpp
pcl_ros
sensor_msgs
geometry_msgs
tf
tf_conversions
eigen_conversions
nav_msgs
rviz_visual_tools
#octomap_world
octomap_msgs
)
FIND_PACKAGE(CUDA)
find_package(Boost REQUIRED)
# CGAL and its components
#find_package(CGAL QUIET COMPONENTS)
if (OPENMP_FOUND)
message(STATUS "*************************************************************************************************")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
catkin_package(
INCLUDE_DIRS include
${OCTOMAP_INCLUDE_DIRS}
LIBRARIES ${OCTOMAP_LIBRARIES} ${OCTOMAP_LIBRARIES_DIR}
CATKIN_DEPENDS roscpp pcl_ros octomap_msgs
)
include_directories(include
${catkin_INCLUDE_DIRS}
${rviz_visual_tools_INCLUDE_DIRS}
${OCTOMAP_INCLUDE_DIRS}
)
set(CUDA_FOUND false)
if(CUDA_FOUND)
message(STATUS "CUDA Version: ${CUDA_VERSION_STRINGS}")
message(STATUS "CUDA Libararies: ${CUDA_LIBRARIES}")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
-O3
-gencode arch=compute_30,code=sm_30
-gencode arch=compute_35,code=sm_35
-gencode arch=compute_50,code=[sm_50,compute_50]
-gencode arch=compute_52,code=[sm_52,compute_52]
#-gencode arch=compute_61,code=sm_61
#-gencode arch=compute_62,code=sm_62
)
#add_definitions(-DGPU)
cuda_add_library(frustum_culling_gpu src/frustum_culling_gpu.cu)
cuda_add_library(voxel_grid_occlusion_estimation_gpu src/voxel_grid_occlusion_estimation_gpu.cu)
add_library(occlusion_culling_gpu src/occlusion_culling_gpu.cpp)
target_link_libraries(occlusion_culling_gpu frustum_culling_gpu voxel_grid_occlusion_estimation_gpu ${catkin_LIBRARIES} ${PCL_LIBRARIES})
endif()
add_library(occlusion_culling
src/occlusion_culling.cpp
src/voxel_grid_occlusion_estimation.cpp
src/frustum_culling.cpp
)
target_link_libraries(occlusion_culling ${catkin_LIBRARIES} ${PCL_LIBRARIES})
add_executable(occlusion_culling_test src/occlusion_culling_test.cpp)
#add_dependencies(occlusion_culling_test ${catkin_EXPORTED_TARGETS})
target_link_libraries(
occlusion_culling_test occlusion_culling
${catkin_LIBRARIES}
)
#add_executable(occlusion_culling_test
# src/occlusion_culling_test.cpp
# src/occlusion_culling.cpp
# src/voxel_grid_occlusion_estimation.cpp
# src/frustum_culling.cpp)
#add_dependencies(occlusion_culling_test ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
#target_link_libraries(occlusion_culling_test ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${fcl_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES} ${LIBFCL_LIBRARIES})
#add_executable (voxel_grid_occlusion_estimation_test src/voxel_grid_occlusion_estimation_test.cpp)
#target_link_libraries(voxel_grid_occlusion_estimation_test ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${fcl_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${OCTOMAP_LIBRARIES} ${LIBFCL_LIBRARIES})