[CMake] How to ignore configure warnings in a ctest run?

David Cole david.cole at kitware.com
Tue May 29 14:39:54 EDT 2012


CDash "configure" warnings are computed dynamically by CDash based only on
the configure output itself with php code like this:

    $pos1 = strpos($log, 'CMake Warning', $position);
    $pos2 = strpos($log, 'Warning:', $position);

(see CDash/models/buildconfigure.php for more details)

So the only way to avoid them showing up on CDash is to avoid emitting the
warnings in the first place.


You can use code like this in your CMakeLists file if you wish to show the
warning only for non-dashboard builds:

  if("$ENV{DASHBOARD_TEST_FROM_CTEST}" STREQUAL "")
    # developer (non-dashboard) build
    message(WARNING "show warning to real user")
  else()
    # dashboard build
    message(STATUS "avoiding warning on dashboard")
  endif()

That environment variable is set by ctest only when it is running a
dashboard via the -D command line options, or via a -S script.


HTH,
David


On Fri, May 25, 2012 at 5:38 AM, Matthias Kretz <kretz at kde.org> wrote:

> Hi,
>
> in my project I added a few warnings to tell users of the library about
> compiler issues or such. But when I run a nightly build with such a
> compiler I
> really don't care to see that warning (well, rather I'd like to see a
> warning
> if the warning is missing) on the dashboard. But I didn't succeed in
> ignoring
> the warning yet. It appears that CTEST_CUSTOM_WARNING_EXCEPTION is not used
> for configure output, is it?
> Do you know of any way to do it, or would it be possible to have some way
> to
> do it in a future version?
>
> Regards,
>        Matthias
> --
> ________________________________________________________
> Matthias Kretz (Germany)                            <><
> http://kretzfamily.de/
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120529/071a6a0e/attachment.htm>


More information about the CMake mailing list