[CMake] Build Library from generated files

Pascal Bach pascal.bach at gmx.ch
Wed Sep 4 04:26:37 EDT 2013


Hello everybody

I'm trying to build a library from source files that are generated at build
time. The setup is the following.

Inputfiles (Service.thrift)   -> Thrift Compiler/Generator -> Several
generated files (gen-cpp/Service.h, gen-cpp/Service.cpp, gen-cpp/Types.h,
[possibly more] -> Build Library -> Library (thrift-service.so)

The idea is to rebuild the library whenever one of the Service.thrift file
changes.
The problem is that I don't know the output of the generated files in
advanced so I like to use all the files generated by the generator and pack
them in a library.

I tried to use add_custom_command() but as I don't know what's the output
of the generator I didn't succeed.

Is there a way to handle this scenario?

Regards
Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130904/a889077c/attachment.htm>


More information about the CMake mailing list