[CMake] parallel make -j N

Bill Hoffman bill.hoffman at kitware.com
Mon Jan 16 12:37:14 EST 2012


On 1/16/2012 12:10 PM, Andrea Galeazzi wrote:
> I generated a MakeFile Project (MinGW) and I'd like to speed up the
> build process using -j N option. So I launched:
> "make -j 2 all".
> Unfortunately I noticed that the Makefile, generated by CMake self,
> contains this row: $(MAKE) -f CMakeFiles\Makefile2 all , so Makefile2
> won't be executed in parallel mode.
> How can I pass this option to all build steps?
> --
>
gmake will do the right thing.  when you run a toplevel make with -j2 it 
will set an env var that is passed down to the $(MAKE) and it should 
work.  I use it all the time.

-Bill



More information about the CMake mailing list