Debian Codegraph @

cmake/tribits/core/utils/AppendGlobalSet.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}/GlobalSet.cmake")
11 include("${CMAKE_CURRENT_LIST_DIR}/AssertDefined.cmake")
12
13
14 # @FUNCTION: append_global_set()
15 #
16 # Utility macro that appends arguments to a global variable (reduces
17 # boiler-plate code and mistakes).
18 #
19 # Usage::
20 #
21 # append_global_set(<varName> <arg0> <arg1> ...)
22 #
23 # NOTE: The variable ``<varName>`` must exist before calling this function.
24 # To set it empty initially use `global_null_set()`_.
25 #
26 function(append_global_set VARNAME)
27 assert_defined(${VARNAME})
28 list(APPEND ${VARNAME} ${ARGN})
29 global_set(${VARNAME} ${${VARNAME}})
30 endfunction()