[CMake] CTEST_BUILD_CONFIGURATION is being ignored

Michael Pfeuti michael.pfeuti at 3dimpactmedia.com
Thu Mar 22 03:56:16 EDT 2012


thanks, this worked.

Regards
Michael

---------------------------------------------------------
> Hi again,

>
> I possibly discovered a BUG. I have the following excerpt from my ctest
> script that I execute with "ctest -S". In Version 1, I try telling ctest to
> tell the configuration to configure a Debug Build. But this didn't work.
> I specifically need to pass the option to the ctest_configure as shown in
> Version 2. Is there something I didn't get conceptually, or can someone
> explain to me why Version 1 doesn't work?
>
> Version 1:
> ...
> SET_PROPERTY(GLOBAL PROPERTY SubProject "Debug")
> # TODO: I think this is a bug in ctest that we need to pass the option
> explicitly to configure
> SET(CTEST_BUILD_CONFIGURATION           "Debug")
>
> CTEST_START(Experimental)
> CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_SUBMIT()
>
>
> Version 2:
> ...
> SET_PROPERTY(GLOBAL PROPERTY SubProject "Debug")
> SET(CTEST_BUILD_CONFIGURATION           "Debug")
>
>
> CTEST_START(Experimental)
> CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}"
>                 OPTIONS "-DCMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}")
> CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_COVERAGE(BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_SUBMIT()
>
> Kind Regards
> Michael
>
>
>
> --
>
> 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


Because of this bug (which is now fixed, since at least CMake 2.8.3 and above):
http://public.kitware.com/Bug/view.php?id=2336

The fix was to introduce a new variable, named
CTEST_CONFIGURATION_TYPE that applies to configure, build and test
steps, rather than the older variable which only applied to the build
step.

Use CTEST_CONFIGURATION_TYPE instead, and your first script should
work as you expect.


HTH,
David  


More information about the CMake mailing list