[CMake] Shared intermediary files

John Drescher drescherjm at gmail.com
Tue Feb 21 09:45:19 EST 2012


On Mon, Feb 20, 2012 at 4:07 PM, Kevin Schmidt <kevin at eyesopen.com> wrote:
> Hello,
>
>   I’m in the process of converting over a large, monolithic tree with many
> libraries from a custom build solution over to cmake.  So far, we’ve loved
> it.  I am wondering about others’ solutions to a problem we have
> encountered.
>
>
>
> We have more than a few cases of generated source files - for example, Qt
> moc files.   These all get dumped into CMAKE_CURRENT_BINARY_DIR.  Now, the
> libraries we have build both static & shared, and have the same source
> files.  In Visual Studio, this generates two projects in the solution.  It
> seems that these do not share dependencies.  Occasionally, this means that
> both libraries try to write to the generated source file at the same time,
> which generates a (false) build failure.
>
>
>
> What do others do?  Am I misunderstanding something?
>

I have my batch build script that calls cmake --build for each
configuration build 2 times. This works for almost all cases. However
when building VTK in parallel the generation of 1 unicode header
usually fails.

John


More information about the CMake mailing list