[cmake-developers] add_custom_command differences in tests

Brad King brad.king at kitware.com
Fri Feb 7 17:01:38 EST 2014


On 02/07/2014 04:46 PM, Jean-Christophe Fillion-Robin wrote:
>>     I have been able to determine that the code isn’t working because it seems that when running from ctest, cmake seems to be running in a configuration-less mode. Ie CMAKE_BUILD_TYPE/CMAKE_CONFIGURATION_TYPE are not set regardless of the -C option passed to ctest.    I would have thought that the
>>     build configuration of the test would match the configuration set with ‘ctest -C .'
> Agreed. Is there an issue in the tracker to document that problem ?

No, because it is not a bug, at least in so far as it is not intended
to work.  Also it only influences CMake's own testing and not other
projects so it is not public-facing behavior.

A few calls in Tests/CMakeLists.txt add

 -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}

to force building with the tested configuration but most tests do not
need this.  Most tests work in any configuration and do not depend on
being built as the same configuration that the running CMake was.

Steve W, can you post your tests as a patch or point us to a repo
where they are published so we can see how you're trying to test the
new CONFIG option?

Thanks,
-Brad




More information about the cmake-developers mailing list