-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (50 loc) · 1.23 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
cmake_minimum_required(VERSION 3.18)
project(transfusion)
include(CheckLanguage)
check_language(CUDA)
if(NOT CMAKE_CUDA_COMPILER)
message(WARNING "CUDA not found")
return()
endif()
enable_language(CUDA)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
find_package(CUDAToolkit REQUIRED)
find_package(Open3D QUIET)
find_package(TensorRT REQUIRED)
if (NOT TARGET Open3D::Open3D)
include(FetchContent)
FetchContent_Declare(
open3d
GIT_REPOSITORY https://github.com/intel-isl/Open3D.git
GIT_TAG v0.17.0
)
FetchContent_MakeAvailable(open3d)
endif()
add_library(${PROJECT_NAME} SHARED
src/kernels.cu
src/preprocess.cpp
src/transfusion.cpp
)
target_include_directories(${PROJECT_NAME}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES "75;80;86")
target_link_libraries(${PROJECT_NAME}
CUDA::cudart
TensorRT::TensorRT
)
add_executable(${PROJECT_NAME}_main
src/main.cpp
)
target_link_libraries(${PROJECT_NAME}_main
Open3D::Open3D
${PROJECT_NAME}
)
install(TARGETS ${PROJECT_NAME}
DESTINATION lib
)
install(TARGETS ${PROJECT_NAME}_main
DESTINATION bin
)