| 1 |
# @HEADER |
| 2 |
# ***************************************************************************** |
| 3 |
# TriBITS: Tribal Build, Integrate, and Test System |
| 4 |
# |
| 5 |
# Copyright 2013-2016 NTESS and the TriBITS contributors. |
| 6 |
# SPDX-License-Identifier: BSD-3-Clause |
| 7 |
# ***************************************************************************** |
| 8 |
# @HEADER |
| 9 |
|
| 10 |
|
| 11 |
# @FUNCTION: multiline_set() |
| 12 |
# |
| 13 |
# Function to set a single string by concatenating a list of separate strings |
| 14 |
# |
| 15 |
# Usage:: |
| 16 |
# |
| 17 |
# multiline_set(<outputStrVar> |
| 18 |
# "<string0>" |
| 19 |
# "<string1>" |
| 20 |
# ... |
| 21 |
# ) |
| 22 |
# |
| 23 |
# On output, the local variables ``<outputStrVar>`` is set to:: |
| 24 |
# |
| 25 |
# "<string0><string1>..." |
| 26 |
# |
| 27 |
# The purpose of this is function to make it easier to set longer strings over |
| 28 |
# multiple lines. |
| 29 |
# |
| 30 |
# This function is exactly the same as `concat_strings()`_ and should not even |
| 31 |
# exist :-( |
| 32 |
# |
| 33 |
function(multiline_set VARAIBLE_NAME) |
| 34 |
|
| 35 |
set(MULTILINE_SET_LOCAL_STR "") |
| 36 |
|
| 37 |
foreach(LINE_STR ${ARGN}) |
| 38 |
set(MULTILINE_SET_LOCAL_STR "${MULTILINE_SET_LOCAL_STR}${LINE_STR}") |
| 39 |
endforeach() |
| 40 |
|
| 41 |
set(${VARAIBLE_NAME} "${MULTILINE_SET_LOCAL_STR}" PARENT_SCOPE) |
| 42 |
|
| 43 |
endfunction() |