diff options
author | Brad King <brad.king@kitware.com> | 2017-08-16 14:50:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-16 14:50:38 (GMT) |
commit | d817bbb8dfda07e94850c73811b7a520cb65c6f0 (patch) | |
tree | a4e8a335a66244e1fce7cb41301dce8df171a14b /Tests/RunCMake/string/Prepend.cmake | |
parent | 75b3866a8ebfbb2823611ebc7e7febeea2bd91c1 (diff) | |
parent | d8ecc2545798c77ec5bf22bb420a3343d4843ef6 (diff) | |
download | CMake-d817bbb8dfda07e94850c73811b7a520cb65c6f0.zip CMake-d817bbb8dfda07e94850c73811b7a520cb65c6f0.tar.gz CMake-d817bbb8dfda07e94850c73811b7a520cb65c6f0.tar.bz2 |
Merge topic 'string_prepend'
d8ecc254 Add PREPEND sub-command to string command
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1129
Diffstat (limited to 'Tests/RunCMake/string/Prepend.cmake')
-rw-r--r-- | Tests/RunCMake/string/Prepend.cmake | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Prepend.cmake b/Tests/RunCMake/string/Prepend.cmake new file mode 100644 index 0000000..8eaeebb --- /dev/null +++ b/Tests/RunCMake/string/Prepend.cmake @@ -0,0 +1,58 @@ +set(out) +string(PREPEND out) +if(DEFINED out) + message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"") +endif() + +set(out "") +string(PREPEND out) +if(NOT out STREQUAL "") + message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"") +endif() + +set(out x) +string(PREPEND out) +if(NOT out STREQUAL "x") + message(FATAL_ERROR "\"string(PREPEND out)\" set out to \"${out}\"") +endif() + + +set(out) +string(PREPEND out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"") +endif() + +set(out "") +string(PREPEND out a) +if(NOT out STREQUAL "a") + message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"") +endif() + +set(out x) +string(PREPEND out a) +if(NOT out STREQUAL "ax") + message(FATAL_ERROR "\"string(PREPEND out a)\" set out to \"${out}\"") +endif() + + +set(out x) +string(PREPEND out a "b") +if(NOT out STREQUAL "abx") + message(FATAL_ERROR "\"string(PREPEND out a \"b\")\" set out to \"${out}\"") +endif() + +set(b) +set(out x) +string(PREPEND out ${b}) +if(NOT out STREQUAL "x") + message(FATAL_ERROR "\"string(PREPEND out \${b})\" set out to \"${out}\"") +endif() + +set(b b) +set(out x) +string(PREPEND out a "${b}" [[ +${c}]]) +if(NOT out STREQUAL "ab\${c}x") + message(FATAL_ERROR "\"string(PREPEND out a \"\${b}\" [[\${c}]])\" set out to \"${out}\"") +endif() |