# Comment line for custom target has added leading 1\>

**URL:** https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [July 30, 2026, 7:02pm UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764 "2026-07-30T19:02:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [July 30, 2026, 7:02pm UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764/1 "2026-07-30T19:02:07Z")

</div>

For example:

```cmake
    set(name example)
    add_executable(${name} ${...})

    set(customName customTarget)
    add_custom_target(${customName} COMMENT "#${customName}"
        COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_FILE:${name}>
    )

```

```auto
1>#customTarget
<path to build folder>/Debug/example.exe

```

Is this 1\> a bug, intended to redirect it to the standard error?

---

<div class="post-metadata">

### Author: ![Angew](https://discourse.cmake.org/user_avatar/discourse.cmake.org/angew/32/229_2.png) [@Angew](https://discourse.cmake.org/u/Angew)
#### Post date: [July 30, 2026, 7:20pm UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764/2 "2026-07-30T19:20:36Z")

</div>

Can you share more about your build environment? This looks like the way MSBuild prefixes project build output with the ordinal number of the project being built.

---

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [July 31, 2026, 11:22am UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764/3 "2026-07-31T11:22:49Z")

</div>

As of right now the generator is not explicitly specified, so it defaults:  
CMAKE\_GENERATOR:INTERNAL=Visual Studio 18 2026

Is it documented that Visual Studio does that? I am not using a full Visual Studio install, only build tools.

---

<div class="post-metadata">

### Author: ![Wallby](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/4491bb/32.png) [@Wallby](https://discourse.cmake.org/u/Wallby)
#### Post date: [July 31, 2026, 11:25am UTC](https://discourse.cmake.org/t/comment-line-for-custom-target-has-added-leading-1/15764/4 "2026-07-31T11:25:49Z")

</div>

This is not the first project I have used a custom target COMMENT, in for printing a marker which indicates the start of the custom target’s output. I can’t remember if I have ever ran in to this issue in the past. If I have, I very much forgot.
