diff options
author | Brad King <brad.king@kitware.com> | 2020-10-19 19:20:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-11 13:24:21 (GMT) |
commit | c257c25419c68e755b0f8289d8d563437bf9e0c2 (patch) | |
tree | 20418dcf8153ad50a55a4f7a4c0bc14cdb9de22f /Tests/RunCMake/add_custom_command | |
parent | f36af9228b2ad36442f0cce9e8c8533fadef65aa (diff) | |
download | CMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.zip CMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.tar.gz CMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.tar.bz2 |
add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTS
Move rejection of `#`, `<`, and `>` characters in outputs and byproducts
to a generate-time check. This removes the front-end check that
disallowed generator expressions. The generators have already been
updated to handle them.
Fixes: #12877
Diffstat (limited to 'Tests/RunCMake/add_custom_command')
4 files changed, 46 insertions, 22 deletions
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt index 086e397..6d51575 100644 --- a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt +++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt @@ -1,36 +1,47 @@ CMake Error at BadByproduct.cmake:2 \(add_custom_command\): - add_custom_command called with BYPRODUCTS containing a "#". This character - is not allowed. + BYPRODUCTS containing a "#" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) CMake Error at BadByproduct.cmake:3 \(add_custom_command\): - add_custom_command called with BYPRODUCTS containing a "<". This character - is not allowed. + BYPRODUCTS containing a "<" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) CMake Error at BadByproduct.cmake:4 \(add_custom_command\): - add_custom_command called with BYPRODUCTS containing a ">". This character - is not allowed. + BYPRODUCTS containing a ">" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) - +( CMake Error at BadByproduct.cmake:5 \(add_custom_command\): - add_custom_command called with BYPRODUCTS containing a "<". This character - is not allowed. + BYPRODUCTS containing a "#" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) - +)+ CMake Error at BadByproduct.cmake:6 \(add_custom_command\): - add_custom_command attempted to have a file + BYPRODUCTS path .*RunCMake/add_custom_command/f in a source directory as an output of custom command. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + +( +CMake Error at BadByproduct.cmake:7 \(add_custom_command\): + Error evaluating generator expression: + + \$<TARGET_PROPERTY:prop> + + \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not + be used with add_custom_command or add_custom_target. Specify the target + to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + +)+ diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake index 91bca52..7c786a4 100644 --- a/Tests/RunCMake/add_custom_command/BadByproduct.cmake +++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake @@ -4,3 +4,4 @@ add_custom_command(OUTPUT b BYPRODUCTS "a<") add_custom_command(OUTPUT c BYPRODUCTS "a>") add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#") add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f) +add_custom_command(OUTPUT f BYPRODUCTS "$<TARGET_PROPERTY:prop>") diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt index 731e58d..506bec9 100644 --- a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt +++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt @@ -1,36 +1,47 @@ CMake Error at BadOutput.cmake:2 \(add_custom_command\): - add_custom_command called with OUTPUT containing a "#". This character is - not allowed. + OUTPUT containing a "#" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) CMake Error at BadOutput.cmake:3 \(add_custom_command\): - add_custom_command called with OUTPUT containing a "<". This character is - not allowed. + OUTPUT containing a "<" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) CMake Error at BadOutput.cmake:4 \(add_custom_command\): - add_custom_command called with OUTPUT containing a ">". This character is - not allowed. + OUTPUT containing a ">" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) - +( CMake Error at BadOutput.cmake:5 \(add_custom_command\): - add_custom_command called with OUTPUT containing a "<". This character is - not allowed. + OUTPUT containing a "#" is not allowed. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) - +)+ CMake Error at BadOutput.cmake:6 \(add_custom_command\): - add_custom_command attempted to have a file + OUTPUT path .*RunCMake/add_custom_command/e in a source directory as an output of custom command. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + +( +CMake Error at BadOutput.cmake:7 \(add_custom_command\): + Error evaluating generator expression: + + \$<TARGET_PROPERTY:prop> + + \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not + be used with add_custom_command or add_custom_target. Specify the target + to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + +)+ diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake index 6875fe9..77acb7f 100644 --- a/Tests/RunCMake/add_custom_command/BadOutput.cmake +++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake @@ -4,3 +4,4 @@ add_custom_command(OUTPUT "a<" COMMAND b) add_custom_command(OUTPUT "a>" COMMAND c) add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d) add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f) +add_custom_command(OUTPUT "$<TARGET_PROPERTY:prop>" COMMAND g) |