-
Notifications
You must be signed in to change notification settings - Fork 72
/
CMakeLists.txt
24 lines (19 loc) · 1018 Bytes
/
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
project(PointNet2)
cmake_minimum_required(VERSION 2.8)
find_package(CUDA REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/utils/cinclude")
cuda_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/utils/cinclude")
file(GLOB cuda_kernels_src "${CMAKE_CURRENT_SOURCE_DIR}/utils/csrc/*.cu")
cuda_compile(cuda_kernels SHARED ${cuda_kernels_src} OPTIONS -O3)
set(BUILD_CMD python "${CMAKE_CURRENT_SOURCE_DIR}/utils/build_ffi.py")
file(GLOB wrapper_headers "${CMAKE_CURRENT_SOURCE_DIR}/utils/cinclude/*wrapper.h")
file(GLOB wrapper_sources "${CMAKE_CURRENT_SOURCE_DIR}/utils/csrs/*.c")
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/utils/_ext/pointnet2/_pointnet2.so"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils
COMMAND ${BUILD_CMD} --build --objs ${cuda_kernels}
DEPENDS ${cuda_kernels}
DEPENDS ${wrapper_headers}
DEPENDS ${wrapper_sources}
VERBATIM)
add_custom_target(pointnet2_ext ALL
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/utils/_ext/pointnet2/_pointnet2.so")