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