NVIDIAGameWorks / RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
Other
504 stars 46 forks source link

Adding CMake config file for the shipped SDK #43

Open JiayinCao opened 2 years ago

JiayinCao commented 2 years ago

Hi,

I would like to make a suggestion for a small improvement for the NRD project.

As a user, I high appreciate the usage of CMake to make the compilation process a lot simpler. However, the prepared SDK doesn't come with a CMake config file, which would mean my own project would have to setup everything manually.

Here is what I did in my experimental project CMake script

include_directories(${PROJECT_DEPENENCIES}/nrd/Include)
link_directories(${PROJECT_DEPENENCIES}/nrd/Lib/Release)
target_link_libraries(ProjectName NRD)

This is a reasonable solution to include the NRD project in my own project, except a few minor catches

It would be nice if the NRD project could generate a CMake config file. This would make the NRD users, I mean those who indeed use CMake in their system, a lot easier to integration. Eventually, integrating NRD in their CMake project would simply be

find_package(NRD REQUIRED FATAL_ERROR HINTS ${PROJECT_DEPENENCIES}/nrd/CMake)
target_link_libraries(ProjectName NRD)

This doesn't really just save one line coding. The two issues mentioned above would be gone. From the users perspective, they won't care about how the files are structured inside the SDK, at least for Cpp host project. Though for the shader header file, they would still need to inform the dxc/fxc to add the include directory in some way.

This, of course, is only a minor improvement to the system. And it would only help users who use CMake in their own system, which does limit the benefit of this improvement unfortunately.

Thanks Jiayin

dzhdanNV commented 2 weeks ago

3 years has passed... my bad... but I'm still happy to accept a merge request :)