[CMake] One target being built several times during parallel build

Brad King brad.king at kitware.com
Tue Jun 16 12:10:27 EDT 2009


Denis Scherbakov wrote:
> 6. gmake -j5 mytest printf
> 7. I observe target PUTS being built 2 times and "Building CXX object puts/CMakeFiles/puts.dir/puts.cpp.o" 2 times. Also counter goes to 150%.

Your project looks fine.

I missed in your earlier post that you ran "gmake -j9 E1 E2 E3".
The problem is that the Makefiles that CMake generates do not
support parallel builds with multiple targets on the command line.
(I don't remember the reason off the top of my head, but I think
there was a conflict between this and some other features that
were deemed more important.)

Parallel builds work very well as long as only one initial target
is specified.  You can also specify no initial target and it will
build all targets with maximum possible parallelism.

-Brad


More information about the CMake mailing list