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

David Cole david.cole at kitware.com
Wed Mar 14 15:35:29 EDT 2012


Nothing's changed w.r.t. running ctest via the RUN_TESTS project.

You could always add your own custom target if you want to run ctest
with additional arguments.


HTH,
David


On Wed, Mar 14, 2012 at 3:18 PM, Massaro Alessio
<Alessio.Massaro at mediobanca.co.uk> wrote:
> 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()
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list