Debian Codegraph @

cmake/tribits/core/utils/AppendStringVarWithSep.cmake

raw
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 include("${CMAKE_CURRENT_LIST_DIR}/ConcatStrings.cmake")
11
12
13 # @FUNCTION: append_string_var_with_sep()
14 #
15 # Append strings to a given string variable, joining them using a separator
16 # string.
17 #
18 # Usage::
19 #
20 # append_string_var_with_sep(<stringVar> "<sepStr>" "<str0>" "<str1>" ...)
21 #
22 # Each of the strings ``<stri>`` are appended to ``<stringVar>`` using the
23 # separation string ``<sepStr>``.
24 #
25 function(append_string_var_with_sep STRING_VAR SEP_STR)
26 #message("APPEND_STRING_VAR: '${STRING_VAR}' '${SEP_STR}' ${ARGN}")
27 #print_var(STRING_VAR)
28 #print_var(${STRING_VAR})
29 if (${STRING_VAR})
30 concat_strings( TMP_STRING "${${STRING_VAR}}${SEP_STR}" ${ARGN} )
31 else()
32 concat_strings( TMP_STRING ${ARGN} )
33 endif()
34 #print_var( TMP_STRING )
35 set(${STRING_VAR} "${TMP_STRING}" PARENT_SCOPE)
36 #set(${STRING_VAR} "${${STRING_VAR}}${LINE}" PARENT_SCOPE)
37 #print_var(STRING_VAR)
38 endfunction()