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

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

Reply via email to