[cmake-developers] add_custom_command differences in tests

Steve Wilson stevew at wolfram.com
Fri Feb 7 17:19:07 EST 2014


On Feb 7, 2014, at 3:01 PM, Brad King <brad.king at kitware.com> wrote:

> 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}

I have tried adding that to my test call (—build-options) but it doesn’t seem to make any difference.

> 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.

This particular feature I am testing tests add_custom_command in different configurations, so configurations do matter in this scenario.

> 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?

I pushed the add-custom-command-config-tmp branch to stage.   This branch does not represent the final topic branch I intend to submit.   It is only my local working branch.   It contains a sample test in Tests/CustomCommand/ConfigTest.    I will remove it as soon as you have seen what you need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140207/00c2594d/attachment-0002.sig>


More information about the cmake-developers mailing list