CMake: "dereference" INCLUDE commands to create a single CMakeLists.txt

13 views Asked by At

I'd like to export/install an example project that shows how to use my CMake module (basically a C library). I'd like to distribute a CMakeLists.txt with the example that builds a hello-world-like executable that links with my library. The in-source version of the example's CMakeLists.txt INCLUDEs some cmake fragments that are also used elsewhere.

I'd like to replace these INCLUDE commands with the contents of the files (recursively) so that eventually a single CMakeLists.txt remains that can be distributed, similarly to what latexepand does for LaTeX documents. Is there any built-in functionality that can help with that? Searching for "cmake" and "include" is not exactly very fruitful... :)

0

There are 0 answers