# @HEADER # ***************************************************************************** # TriBITS: Tribal Build, Integrate, and Test System # # Copyright 2013-2016 NTESS and the TriBITS contributors. # SPDX-License-Identifier: BSD-3-Clause # ***************************************************************************** # @HEADER include(AssertDefined) include(AppendStringVarWithSep) # @FUNCTION: print_nonempty_var_with_spaces() # # Print a list variable giving its name then value printed with spaces instead # of ``';'``, but only if the list is non-empty. # # Usage:: # # print_nonempty_var_with_spaces( ) # # Prints the variable as:: # # : ... # # If ```` is ``TRUE`` on input, then the variable is not # touched. If however, the variable ```` is not ``TRUE`` and # the list ```` in non-empty, then ```` is set to # ``TRUE`` on output. # function(print_nonempty_var_with_spaces variableName printedVarOut) if (NOT "${${variableName}}" STREQUAL "") string(REPLACE ";" " " OUTSTR "${${variableName}}") message("-- ${variableName}: ${OUTSTR}") set(${printedVarOut} TRUE PARENT_SCOPE) endif() endfunction()