-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (30 loc) · 1.09 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
cmake_minimum_required(VERSION 3.12)
project(UnityDenoiserPlugin)
set(target_name "UnityDenoiserPlugin")
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Find the OptiX library
find_package(OptiX REQUIRED)
find_package(CUDA REQUIRED)
# Add your project's source files here
file(GLOB SOURCE_FILES Sources/*.cpp)
add_library(${target_name} SHARED ${SOURCE_FILES})
# Add include directories
target_include_directories(${target_name} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Externals/UnityPluginAPI
${OptiX_INCLUDE}
${CUDA_INCLUDE_DIRS}
)
# pch file
target_precompile_headers(${target_name} PRIVATE Sources/pch.h)
# Link against the necessary OptiX libraries
target_link_libraries(${target_name} ${OptiX_LIBRARIES} ${CUDA_LIBRARIES})
# OIDN
set(OIDN_DEVICE_CPU OFF)
set(OIDN_DEVICE_CUDA ON)
set(OIDN_APPS OFF)
add_subdirectory(Externals/oidn)
target_include_directories(${target_name} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Externals/oidn/include)
add_dependencies(${target_name} OpenImageDenoise2)
target_link_libraries(${target_name} OpenImageDenoise2)