Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CMake config file for the shipped SDK. #43

Open
JiayinCao opened this issue Sep 5, 2022 · 0 comments
Open

Adding CMake config file for the shipped SDK. #43

JiayinCao opened this issue Sep 5, 2022 · 0 comments

Comments

@JiayinCao
Copy link

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

  • In the future when the file structure is changed, further upgrading of NRD would require me, in general all users who want to upgrade, to update their build script manually since there is an implicit connection between the user project and NRD project.
  • If the depenendcy is not there in the folder, CMake won't tell during project generation time. It would only tell during compliation, most likely compiler saying no header existed.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant