I’m porting some obscure library from autotools to cmake.
The library in question compiles custom tool that outputs header into stdout, and this header is used later in the project.
How can I port that to cmake?
I can compile “header generator” using
add_executable(generator generator.c)
But how can I run it and redirect its output to header file using cmake? I’ll also need dependency handling of course… (i.e. if generator.c changes, generator must be recompiled and header must be regenerated).
Found it: “How can I generate a source file during the build?”