Debian Codegraph @

cmake/tribits/core/utils/PrependCmndlineArgs.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
11 # @FUNCTION: prepend_cmndline_args()
12 #
13 # Utility function that prepends command-line arguments to a variable of
14 # command-line arguments.
15 #
16 # Usage::
17 #
18 # prepend_cmndline_args(<var> "<extraArgs>")
19 #
20 # This function just prepends the command-line arguments in the string
21 # ``"<extraArgs>"`` but does not add an extra space if ``<var>`` is empty on
22 # input.
23 #
24 function(prepend_cmndline_args CMNDLINE_VAR_NAME EXTRAARGS)
25 if (${CMNDLINE_VAR_NAME})
26 set(${CMNDLINE_VAR_NAME} "${EXTRAARGS} ${${CMNDLINE_VAR_NAME}}" PARENT_SCOPE)
27 else()
28 set(${CMNDLINE_VAR_NAME} "${EXTRAARGS}" PARENT_SCOPE)
29 endif()
30 #print_var(${CMNDLINE_VAR_NAME})
31 endfunction()