-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (41 loc) · 1.21 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
cmake_minimum_required(VERSION 3.4)
# minimum version for modern cmake
project(
Prim3D
DESCRIPTION "Primitive3D: Self-Pratice Library for 3D Data Processing." # Set PROJECT_DESCRIPTION
LANGUAGES CXX CUDA
)
# Primitive3D build options
option(CUDA_ENABLED "Whether to enable CUDA, if available" ON)
option(BUILD_PYTHON_MODULE "Build the python module" ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CUDA_STANDARD 14)
#########
# Eigen #
#########
include_directories("third_party/eigen")
#########
# Optix #
#########
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
message("CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
find_package(Optix)
# set OptiX_INSTALL_DIR via your environment if it's not found automatically
if(OptiX_FOUND OR OptiX_INCLUDE)
include_directories("${OptiX_INCLUDE}")
message("successfully include OptiX")
# Find CUDA
find_package(CUDA REQUIRED)
# compile nvidia support libraries
add_definitions(-DENABLE_OPTIX)
else()
message(WARNING "OptiX was not found.")
endif()
###########
# PyTorch #
###########
find_package(Torch REQUIRED)
find_package(PythonLibs REQUIRED)
find_library(TORCH_PYTHON_LIBRARY torch_python PATHS "${TORCH_INSTALL_PREFIX}/lib")
# Add library
add_subdirectory(src)