[cmake-developers] Running coverage tool with environment (was: CMake strips MAKEFLAGS from environment)

Brad King brad.king at kitware.com
Thu May 21 10:19:20 EDT 2015


On 05/21/2015 09:31 AM, Taylor Braun-Jones wrote:
> I'm trying to implement a workaround solution for setting environment variables
> in my Makefiles at build time. So what I started with was this:
> 
>   set(bullseye_environment COVFILE=${PROJECT_BINARY_DIR}/bullseye/test.cov)
>   add_custom_target(coverage_data
>     COMMAND env ${bullseye_environment}
>       ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --clean-first
>     COMMAND env ${bullseye_environment} ${CMAKE_CTEST_COMMAND} --output-on-failure

We typically run coverage as part of nightly testing with a 'ctest -S'
dashboard client script.  The script surrounds the actual build
invocation and can take responsibility for adding things like COVFILE
to the environment.

-Brad



More information about the cmake-developers mailing list