Closed jeffamstutz closed 3 years ago
@jeffamstutz Awesome! :tada:
Let us give some time review the PR.
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. ;)
Merged! Thanks!
TODO: Add usage doc to README.md
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, wherefind_package(nanort)
...generates the following targets:
nanort::core
--> use only the "base" version of nanortnanort::threads
--> use nanort with C++11 threads enablednanort::openmp
--> use nanort with OpenMP enablednanort::nanort
--> a target which selects OpenMP/threads/core (in that order) depending on what is availableThe 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.