[CMake] Generating include files
Andrew Fuller
afuller at teradici.com
Fri May 19 19:15:46 EDT 2017
> Hm, it's the same info I've already found in other places.
> Unfortunately, I still don't see a way to generate a source file that
> should be #include'd instead of linked into an executable.
I missed that you wanted a .h file that other libraries would pick up. Since CMake isn't aware of which header files a library #includes, you're not getting that dependency information which I guess is what you're running into. I haven't needed to do it myself, but have you tried setting your generated header file in the SOURCES property of your library PUBLICly (or possibly INTERFACE). CMake knows the custom command that OUTPUTs a file, so when it tracks the file it should know the dependency to make it happen. By exporting the header it should convey the dependency to the consumer(s).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170519/69cf8a13/attachment.html>
More information about the CMake
mailing list