custom command comments not showing up

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

custom command comments not showing up

Robert Dailey-2
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom command comments not showing up

Craig Scott-3
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 <[hidden email]> 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

--

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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom command comments not showing up

Hendrik Sattler
However, this messes up parallel make progress output.

Am 7. April 2017 22:22:08 MESZ schrieb Craig Scott <[hidden email]>:

>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
><[hidden email]>
>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
>>

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
--

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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom command comments not showing up

Robert Dailey-2
Seems like the solution here is to make COMMENT work
properly/consistently across all generators. That's the point, after
all, right?

On Sat, Apr 8, 2017 at 12:33 AM, Hendrik Sattler
<[hidden email]> wrote:

> However, this messes up parallel make progress output.
>
> Am 7. April 2017 22:22:08 MESZ schrieb Craig Scott <[hidden email]>:
>>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
>><[hidden email]>
>>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
>>>
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
--

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