[CMake] How to get "cmake --build ." to build in parallel ?

Glenn Coombs glenn.coombs at gmail.com
Wed Oct 3 13:52:22 EDT 2012


I am invoking cmake as part of a jenkins script and am using "cmake --build
." to kick off the build.  This works but does not do the equivalent of
"make -j4" to take advantage of all 4 cores when run on a linux machine.
When run on a windows machine the building in parallel is already taken
care of by an add_definitions(/MP$(NUMBER_OF_PROCESSORS)) command in the
CMakeLists.txt.  Is there a command line option to get "cmake --build" to
invoke make with the appropriate -j option for linux builds ?  Or something
I can add to my CMakeLists.txt similar to the /MP option for Visual Studio
builds ?  Or will I have to invoke "make -j4" on linux and "cmake --build
." on windows instead of being able to keep the same build command
irrespective of OS ?

--
Glenn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121003/81b26627/attachment.htm>


More information about the CMake mailing list