mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Evaluate and expand generator expressions in the `COMMENT` argument of the `add_custom_command()` and `add_custom_target()` commands. This allows to include generator expressions, e.g. a targets location $<TARGET_...> or the current configuration $<CONFIG>, in the build-time messages. Fixes #22507
10 lines
345 B
CMake
10 lines
345 B
CMake
add_custom_target(helper)
|
|
set_property(TARGET helper PROPERTY MY_TEXT "lorem ipsum")
|
|
add_custom_command(
|
|
OUTPUT out.txt
|
|
COMMAND ${CMAKE_COMMAND} -E echo true
|
|
COMMENT "$<TARGET_PROPERTY:helper,MY_TEXT>$<COMMA> $<STREQUAL:foo,bar>$<EQUAL:42,42>"
|
|
)
|
|
set_property(SOURCE out.txt PROPERTY SYMBOLIC 1)
|
|
add_custom_target(main ALL DEPENDS out.txt)
|