| 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(AssertDefined) |
| 11 |
include(PrintVar) |
| 12 |
|
| 13 |
|
| 14 |
# @FUNCTION: print_nonempty_var() |
| 15 |
# |
| 16 |
# Print a defined variable giving its name then value only if it is not empty. |
| 17 |
# |
| 18 |
# Usage:: |
| 19 |
# |
| 20 |
# print_nonempty_var(<varName>) |
| 21 |
# |
| 22 |
# Calls ``print_var(<varName>)`` if ``${<varName>}`` is not empty. |
| 23 |
# |
| 24 |
function(print_nonempty_var VARIABLE_NAME) |
| 25 |
assert_defined(VARIABLE_NAME) |
| 26 |
if (NOT "${${VARIABLE_NAME}}" STREQUAL "") |
| 27 |
print_var(${VARIABLE_NAME}) |
| 28 |
endif() |
| 29 |
endfunction() |