|
| 1 | +# ======================================================================== # |
| 2 | +# Copyright 2019-2022 Qi Wu # |
| 3 | +# # |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); # |
| 5 | +# you may not use this file except in compliance with the License. # |
| 6 | +# You may obtain a copy of the License at # |
| 7 | +# # |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 # |
| 9 | +# # |
| 10 | +# Unless required by applicable law or agreed to in writing, software # |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, # |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # |
| 13 | +# See the License for the specific language governing permissions and # |
| 14 | +# limitations under the License. # |
| 15 | +# ======================================================================== # |
| 16 | + |
| 17 | +# |
| 18 | +# This project is designed to be compiled with OVR |
| 19 | +# |
| 20 | + |
| 21 | +option(OVR_BUILD_MODULE_NNVOLUME "Build Volumetric Neural Representation Device" OFF) |
| 22 | + |
| 23 | +if(OVR_BUILD_MODULE_NNVOLUME) |
| 24 | + |
| 25 | + message(STATUS "Enable Neural Volume Device") |
| 26 | + |
| 27 | + if(DEFINED GDT_CUDA_ARCHITECTURES) |
| 28 | + message(STATUS "Obtained target architecture from environment variable GDT_CUDA_ARCHITECTURES=${GDT_CUDA_ARCHITECTURES}") |
| 29 | + set(ENV{TCNN_CUDA_ARCHITECTURES} ${GDT_CUDA_ARCHITECTURES}) |
| 30 | + endif() |
| 31 | + |
| 32 | + ################ |
| 33 | + # tiny-cuda-nn # |
| 34 | + ################ |
| 35 | + if(NOT TARGET tiny-cuda-nn) |
| 36 | + set(TCNN_BUILD_BENCHMARK OFF) |
| 37 | + set(TCNN_BUILD_EXAMPLES OFF) |
| 38 | + add_subdirectory(tcnn EXCLUDE_FROM_ALL) |
| 39 | + target_compile_definitions(tiny-cuda-nn PUBLIC ${TCNN_DEFINITIONS}) |
| 40 | + target_compile_definitions(tiny-cuda-nn INTERFACE TCNN_NAMESPACE=tcnn) |
| 41 | + target_include_directories(tiny-cuda-nn INTERFACE ${CMAKE_CURRENT_LIST_DIR}/tcnn/include) |
| 42 | + target_include_directories(tiny-cuda-nn INTERFACE ${CMAKE_CURRENT_LIST_DIR}/tcnn/dependencies) |
| 43 | + if(UNIX) |
| 44 | + set_target_properties(tiny-cuda-nn PROPERTIES |
| 45 | + POSITION_INDEPENDENT_CODE ON |
| 46 | + ) |
| 47 | + endif() |
| 48 | + endif() |
| 49 | + |
| 50 | + # Two projects uses different target names ... |
| 51 | + if(TARGET rendercommon) |
| 52 | + add_library(util ALIAS rendercommon) |
| 53 | + endif() |
| 54 | + |
| 55 | + # Simulate include paths |
| 56 | + include_directories(${CMAKE_CURRENT_LIST_DIR}) |
| 57 | + |
| 58 | + ################ |
| 59 | + # |
| 60 | + ################ |
| 61 | + set(MACROCELL_SIZE_MIP 4) |
| 62 | + set(ENABLE_IN_SHADER ON) |
| 63 | + set(ENABLE_OUT_OF_CORE ON) |
| 64 | + set(ENABLE_OPTIX OFF) |
| 65 | + set(ENABLE_OPENGL ON) |
| 66 | + add_subdirectory(core) |
| 67 | + add_subdirectory(shadowmap) |
| 68 | + add_subdirectory(apps) |
| 69 | + |
| 70 | +endif() |
0 commit comments