Debian Codegraph @

cmake/tribits/core/utils/ConcatStrings.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}/PrintVar.cmake")
11
12
13 # @FUNCTION: concat_strings()
14 #
15 # Concatenate a set of string arguments.
16 #
17 # Usage::
18 #
19 # concat_strings(<outputVar> "<str0>" "<str1>" ...)
20 #
21 # On output, ``<outputVar>`` is set to ``"<str0><str1>..."``. This makes it
22 # easier to format a long string over multiple CMake source code lines.
23 #
24 function(concat_strings OUTPUT_STRING_VAR)
25 #message("CONCAT_STRINGS OUTPUT_STRING_VAR: ${OUTPUT_STRING_VAR} {${ARGN}}")
26 #print_var(${OUTPUT_STRING_VAR})
27 set(OUTPUT_STRING "")
28 #print_var(OUTPUT_STRING)
29 foreach(STRING_VAL ${ARGN})
30 #print_var(STRING_VAL)
31 set(OUTPUT_STRING "${OUTPUT_STRING}${STRING_VAL}")
32 #print_var(OUTPUT_STRING)
33 endforeach()
34 set(${OUTPUT_STRING_VAR} "${OUTPUT_STRING}" PARENT_SCOPE)
35 endfunction()