[CMake] Parallel build with custom command

Bill Hoffman bill.hoffman at kitware.com
Tue Oct 7 10:00:53 EDT 2014


On 10/7/2014 2:19 AM, Ruslan Baratov via CMake wrote:
> Hi,
>
> I have a problem with parallel build of project with custom command.
> Custom command generates two files and depends on generator script. For
> optimization purpose first file created only when not exists. This lead
> to conflict, even if I "protect" custom command with a custom target and
> set explicit dependencies:

Can you give an example?

add_dependencies should be what you use.
http://www.cmake.org/cmake/help/v3.0/command/add_dependencies.html
CMake does not know about the generated files.  But if you have targets 
that depend on each other, they will build in order.

-Bill


More information about the CMake mailing list