diff options
author | Raul Tambre <raul@tambre.ee> | 2020-12-19 12:14:18 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-05-31 07:39:58 (GMT) |
commit | 1cb4f592a09752972d89785c0e8f1e160d5b5c4e (patch) | |
tree | 0afc49c1b2e286cf9f24feb9da0b1f52b4a197f8 /Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake | |
parent | 7676e11943a6446e3cdc60370a37e4ce9cc548d3 (diff) | |
download | CMake-1cb4f592a09752972d89785c0e8f1e160d5b5c4e.zip CMake-1cb4f592a09752972d89785c0e8f1e160d5b5c4e.tar.gz CMake-1cb4f592a09752972d89785c0e8f1e160d5b5c4e.tar.bz2 |
add_custom_command: Target-dependent generator expression support
OUTPUT variant with a TARGET given to allow resolving target-based generator
expressions wouldn't work because OUTPUT is resolved before generator targets
are created, i.e. FindGeneratorTargetToUse() returns nullptr.
This is a known limitation, see #21364.
Implements #21336.
Diffstat (limited to 'Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake')
-rw-r--r-- | Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake b/Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake new file mode 100644 index 0000000..8591b74 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/TargetGenexEvent.cmake @@ -0,0 +1,10 @@ +add_custom_target(target ALL) +set_target_properties(target PROPERTIES COMPILE_DEFINITIONS "touched" COMPILE_OPTIONS "${CMAKE_BINARY_DIR}/wdir") +file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/wdir") + +add_custom_command( + TARGET target + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E touch $<TARGET_PROPERTY:COMPILE_DEFINITIONS> + WORKING_DIRECTORY $<TARGET_PROPERTY:COMPILE_OPTIONS> +) |