[CMake] Ctest building with Multiple Processors

Chuck Atkins chuck.atkins at kitware.com
Fri Sep 5 09:33:21 EDT 2014


> Actually my interpretation of the manual says that the _tests_ will be run
> in parallel. What I want is the _Build_ to be run in parallel.
>

Indeed that is just the parallel test execution.  Parallel build is usually
generator specific, controlled through CTEST_BUILD_FLAGS.  For example: if
you're using "Unix Makefiles":

...
set(CTEST_SITE "wopr.kitwarein.com")
set(CTEST_BUILD_NAME "Fedora20_Intel-2013-SP1-U3")
set(CTEST_BUILD_CONFIGURATION Release)
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
*set(CTEST_BUILD_FLAGS -j8)*
...

This will call "make -j8" for the build instead of just "make".  If using
the ninja generator, the build will be parallel by default, or you can
specify a "-j" flag to override that number.  Visual Studio gets a bit
tricky though since you can paralleling at both the target and file level
so if not careful, you can end up with N^2 build processes.  What generator
are you using?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140905/e7ba8e78/attachment.html>


More information about the CMake mailing list