lighttransport / nanort

NanoRT, single header only modern ray tracing kernel.
MIT License
1.07k stars 89 forks source link

modernized CMake #69

Closed jeffamstutz closed 3 years ago

jeffamstutz commented 3 years ago

This PR adds a nanortConfig.cmake and then uses it in the local examples which are built with CMake. The config works like any other CMake package config, where

find_package(nanort)

...generates the following targets:

The config requires CMake >= 3.9 to get the target-based version of CMake's find_package(OpenMP) support.

I ended up getting slightly carried away with further modernizations to the examples, which are stand alone commits to adding the config.

Let me know if this looks helpful/good and if you would like to see any revisions.

syoyo commented 3 years ago

@jeffamstutz Awesome! :tada:

Let us give some time review the PR.

jeffamstutz commented 3 years ago

I have no idea if this is helpful or not, but I recently just posted a vlog on CMake configs where I ended up using the config I wrote in this PR as content to talk to. So if you literally want me to walk you through what's there, here you go! https://youtu.be/GmcMct7LJuE?t=517

The existence of it in that video doesn't at all prevent any changes you might request. ;)

syoyo commented 3 years ago

Merged! Thanks!

TODO: Add usage doc to README.md