[CMake] CTest parallel builds, serial tests

Matt.Bolger at csiro.au Matt.Bolger at csiro.au
Tue Oct 2 19:14:56 EDT 2012


We have a simple automated test/build setup. A basic CTestConfig.cmake sets the project name and CTEST_DROP properties and the test server simply runs "ctest -D Nightly" or "ctest -D Experimental" to process a build.

I have two problems that I think I could solve if I can work out how to specify additional options for the make command used to do the build. To debug a rare issue we're having I'd like to be able to use "make -d" and I would also like to be able to perform the build in parallel "make -j8" but run the tests in serial (this seems to rule out using "ctest -j8")

First I thought I could use the "--build-options<http://www.cmake.org/cmake/help/v2.8.8/ctest.html#opt:--build-options>" option in CTest but after having no luck and looking at the source it looks like this option is only used when "--build-and-test" is requested perhaps? It appears that a number of these command (eg -build-makeprogram) are only used by CTest when used in conjunction with certain other options and not when using "-D"?

I've found some old posts that talk about using a CTest scripting file to set the initial cache value  "MAKECOMMAND:STRING=/usr/bin/make -i -j8" or "set(CTEST_BUILD_COMMAND "make -j4 -i") " - I haven't had much luck with this so far and am wondering if this is still a valid/recommended approach?

Any advice would be greatly appreciated.

Thanks
Matt

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


More information about the CMake mailing list