mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
This is just like CONCAT but accepts a glue string to put between each value. `JOIN ""` is equivalent to `CONCAT`.
17 lines
526 B
CMake
17 lines
526 B
CMake
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()
|