Today I bought Professional CMake, 15th Edition which says, “CMake 3.13 added a special External generator which doesn’t produce packages itself, but instead creates a JSON file which some other process can consume to produce packages outside of CPack.” Unfortunately, it doesn’t say what that other process is that generates the .nupkg, nor give an example CMakeLists,txt fragment. There is only a single paragraph (28.4.11) that makes reference to configuration variables.
The CPack NuGet Generator documentation provides a list of variables but makes no mention of a JSON file. I found the source code for the NuGet generator, which leverages inherited classes and macros and is relatively short. Without understanding the CPack architecture, it is hard to know what it is doing. I’ve googled for an example or sample or tutorial. Nothing. Exploring the git repo, I found the test CMakeLists.txt for the NuGet generator. I merged the example into my CMakeLists.txt, although there were some adjustments as this is a C++ project. Nothing is generated. No JSON, no .nupkg. Perhaps I am missing some basic way in which CPack is used. Could someone please point me at an example or tutorial that would generate a .nupkg file?