[CMake] Ctest building with Multiple Processors

Michael Jackson mike.jackson at bluequartz.net
Wed Sep 3 15:31:16 EDT 2014


I am exploring CTest/CDash with out project and I was trying to figure out how to have CTest use all my cores for builds. So far no luck with some snippets from Google. So far I have the following in a file called CTestConfig.cmake at the top level of my project.

 set(CTEST_PROJECT_NAME "DREAM3D")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D")
set(CTEST_DROP_SITE_CDASH TRUE)

# Use multiple CPU cores to build
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
  if(NOT WIN32)
    set(CTEST_BUILD_FLAGS "-j${N}")
  endif(NOT WIN32)
  set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})

endif()


And then I execute CTest like this from my terminal

ctest -D Experimental


but monitoring my processors says that only a single processor is being used.

Thanks for any help

---
Mike Jackson                 www.bluequartz.net



More information about the CMake mailing list