[CMake] Passing extra parameters to CTest from a RUN_TESTS visual studio project

Massaro Alessio Alessio.Massaro at mediobanca.co.uk
Wed Mar 14 15:18:21 EDT 2012


Hi there

This has been asked before in 2010, but I thought I might check if anything has changed in CMake v2.8.7.

Is it possible to specify extra flags for CTest when it's invoked by the post-build script in a Visual Studio RUN_TESTS project?

Adding the following to my main CMakeLists.txt, main scope, right before enable_testing(), does not work for me.

Thanks in advance!


include(ProcessorCount)
ProcessorCount(NR_OF_CORES)
if(NOT NR_OF_CORES EQUAL 0)
                mb_message(STATUS "Setting CTest to execute ${NR_OF_CORES} test modules in parallel")
                set(CTEST_BUILD_FLAGS -j${NR_OF_CORES} -V)
else()
                set(CTEST_BUILD_FLAGS -V)
endif()

enable_testing()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120314/8cf5b8b2/attachment.htm>


More information about the CMake mailing list