diff options
author | Brad King <brad.king@kitware.com> | 2010-12-08 21:13:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-12-15 19:53:48 (GMT) |
commit | f0cdb6001b3e915fc0d9c1120165d49725440bbd (patch) | |
tree | a310c36370b6935d7458f70a61e3eada72ce8b08 /Tests/CustomCommand | |
parent | 4749e4cb76cc1e23cb23f37ceec2e856a18218ce (diff) | |
download | CMake-f0cdb6001b3e915fc0d9c1120165d49725440bbd.zip CMake-f0cdb6001b3e915fc0d9c1120165d49725440bbd.tar.gz CMake-f0cdb6001b3e915fc0d9c1120165d49725440bbd.tar.bz2 |
Introduce "generator expression" syntax to custom commands (#11209)
Evaluate in the COMMAND arguments of custom commands the generator
expression syntax introduced in commit d2e1f2b4 (Introduce "generator
expressions" to add_test, 2009-08-11). These expressions have a syntax
like $<TARGET_FILE:mytarget> and are evaluated during build system
generation. This syntax allows per-configuration target output files to
be referenced in custom command lines.
Diffstat (limited to 'Tests/CustomCommand')
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 746c9a7..450323e 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -423,3 +423,15 @@ ADD_CUSTOM_TARGET(DifferentName ALL ) # # </SameNameTest> + +# Per-config target name and generator expressions. +ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) +ADD_CUSTOM_COMMAND( + OUTPUT perconfig.out + COMMAND ${PerConfig_COMMAND} + DEPENDS ${PerConfig_DEPENDS} + VERBATIM + ) +ADD_CUSTOM_TARGET(perconfig_target ALL + COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$<TARGET_FILE:perconfig>" "config=$<CONFIGURATION>" + DEPENDS perconfig.out) |