[CMake] custom command comments not showing up

Craig Scott craig.scott at crascit.com
Fri Apr 7 16:22:08 EDT 2017


Unfortunately, COMMENT is unreliable. Some generators will honour it,
others won't. A more robust alternative is to use CMake's command mode to
echo the comment instead. Eg:

add_custom_command( TARGET zApp_zip POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E echo "test2"
        COMMAND ${CMAKE_COMMAND} ARGS ...snip...
    )



On Fri, Apr 7, 2017 at 11:40 PM, Robert Dailey <rcdailey.lists at gmail.com>
wrote:

> So I probably am not understanding how this works.
>
> I have a custom target, that I later add multiple custom commands to.
> Each custom command has a COMMENT set, but the target itself does too:
>
>     add_custom_target(zApp_zip COMMENT "test1")
>
>     add_custom_command( TARGET zApp_zip POST_BUILD
>         COMMAND ${CMAKE_COMMAND} ARGS ...snip...
>         COMMENT "test2"
>     )
>
> Instead of seeing "test1" or "test2" when running, I get:
>
> $ ninja zApp_zip
> [1/1] Running utility command for zApp_zip
>
> Why does it say "Running utility command"? What is the behavior of all
> the comments supposed to be? Is this a ninja-specific issue or
> behavior?
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Craig Scott
Melbourne, Australia
https://crascit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170408/f37677c0/attachment.html>


More information about the CMake mailing list