summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/string/Join.cmake
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2018-02-11 13:20:57 (GMT)
committerBrad King <brad.king@kitware.com>2018-02-16 15:04:47 (GMT)
commit689eeb67cb87a9ed1d91a4971806488d00e68f42 (patch)
tree403880ec3c332705d11c5293940e143fa1a4aa9c /Tests/RunCMake/string/Join.cmake
parente24cda008e3ea1cbb22d17d29c5c39999facb4b7 (diff)
downloadCMake-689eeb67cb87a9ed1d91a4971806488d00e68f42.zip
CMake-689eeb67cb87a9ed1d91a4971806488d00e68f42.tar.gz
CMake-689eeb67cb87a9ed1d91a4971806488d00e68f42.tar.bz2
string: Add JOIN subcommand
This is just like CONCAT but accepts a glue string to put between each value. `JOIN ""` is equivalent to `CONCAT`.
Diffstat (limited to 'Tests/RunCMake/string/Join.cmake')
-rw-r--r--Tests/RunCMake/string/Join.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/string/Join.cmake b/Tests/RunCMake/string/Join.cmake
new file mode 100644
index 0000000..081f1e4
--- /dev/null
+++ b/Tests/RunCMake/string/Join.cmake
@@ -0,0 +1,16 @@
+string(JOIN % out)
+if(NOT out STREQUAL "")
+ message(FATAL_ERROR "\"string(JOIN % out)\" set out to \"${out}\"")
+endif()
+string(JOIN % out a)
+if(NOT out STREQUAL "a")
+ message(FATAL_ERROR "\"string(JOIN % out a)\" set out to \"${out}\"")
+endif()
+string(JOIN % out a "b")
+if(NOT out STREQUAL "a%b")
+ message(FATAL_ERROR "\"string(JOIN % out a \"b\")\" set out to \"${out}\"")
+endif()
+string(JOIN :: out a "b")
+if(NOT out STREQUAL "a::b")
+ message(FATAL_ERROR "\"string(JOIN :: out a \"b\")\" set out to \"${out}\"")
+endif()