[CMake] Generated Files Dependencies

Bill Hoffman bill.hoffman at kitware.com
Tue May 28 15:26:27 EDT 2013


On 5/27/2013 4:45 PM, Mike Krus wrote:
> Hi
>
> I've started to use Protocol Buffers in my project.
>
> .proto files gets "compiled" into c++ .cc and .h files using the
> PROTOBUF_GENERATE_CPP that comes with CMake (2.8.10, Ninja
> generator).
>
> It all works fine except that the generated .cc and .h files become
> dependencies of all the other files in the library, so if I change
> the .proto file, the .cc and .h get regenerated (good), but then my
> entire library gets recompiled (not just the files that #include the
> generated .h file, bad!).
>
> Is there an easy way of stopping this? Is it a CMake bug?

This maybe a ninja bug.  Can you try it with makefiles?

-Bill



More information about the CMake mailing list