diff options
author | Brad King <brad.king@kitware.com> | 2013-10-21 16:49:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-21 16:54:20 (GMT) |
commit | 4e184a21beda9de3703ecda94085c234f5bbd7da (patch) | |
tree | e127479207d0d9677d1713ba1eb08f6d26b3a768 /Tests/RunCMake/string/Concat.cmake | |
parent | 9fb65d7090ca314cd8bfd88e52fefa6905938a6d (diff) | |
download | CMake-4e184a21beda9de3703ecda94085c234f5bbd7da.zip CMake-4e184a21beda9de3703ecda94085c234f5bbd7da.tar.gz CMake-4e184a21beda9de3703ecda94085c234f5bbd7da.tar.bz2 |
string: Add CONCAT sub-command
Add a string(CONCAT) command to simply concatenate input arguments
together. This will be useful for combining strings from different
quoting syntaxes. Add a RunCMake.string test covering these cases.
Diffstat (limited to 'Tests/RunCMake/string/Concat.cmake')
-rw-r--r-- | Tests/RunCMake/string/Concat.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Concat.cmake b/Tests/RunCMake/string/Concat.cmake new file mode 100644 index 0000000..7260c95 --- /dev/null +++ b/Tests/RunCMake/string/Concat.cmake @@ -0,0 +1,19 @@ +set(b b) +set(out x) +string(CONCAT out) +if(NOT out STREQUAL "") + message(FATAL_ERROR "\"string(CONCAT out)\" set out to \"${out}\"") +endif() +string(CONCAT out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(CONCAT out a)\" set out to \"${out}\"") +endif() +string(CONCAT out a "b") +if(NOT out STREQUAL "ab") + message(FATAL_ERROR "\"string(CONCAT out a \"b\")\" set out to \"${out}\"") +endif() +string(CONCAT out a "${b}" [[ +${c}]]) +if(NOT out STREQUAL "ab\${c}") + message(FATAL_ERROR "\"string(CONCAT out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"") +endif() |