| 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(PrependCmndlineArgs) |
| 11 |
include(DualScopeSet) |
| 12 |
|
| 13 |
|
| 14 |
# @MACRO: dual_scope_prepend_cmndline_args() |
| 15 |
# |
| 16 |
# Utility function that prepends command-line arguments to a variable of |
| 17 |
# command-line arguments and sets the result in current scope and parent |
| 18 |
# scope. |
| 19 |
# |
| 20 |
# Usage:: |
| 21 |
# |
| 22 |
# dual_scope_prepend_cmndline_args(<var> "<extraArgs>") |
| 23 |
# |
| 24 |
# Just calls `prepend_cmndline_args()`_ and then ``set(<var> ${<var>} PARENT_SCOPE)``. |
| 25 |
# |
| 26 |
macro(dual_scope_prepend_cmndline_args CMNDLINE_VAR_NAME EXTRAARGS) |
| 27 |
prepend_cmndline_args(${CMNDLINE_VAR_NAME} "${EXTRAARGS}") |
| 28 |
set(${CMNDLINE_VAR_NAME} "${${CMNDLINE_VAR_NAME}}" PARENT_SCOPE) |
| 29 |
endmacro() |