From 637fa77553476311d24f83623d2de9f1af503fc0 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Tue, 19 Sep 2023 11:10:37 -0600 Subject: [PATCH] Remove duplication in tribits_advanced_set_cache_var_and_default() (#582) Now just calls tribits_set_cache_var_and_default() then mark_as_advanced(). Suggested by @KyleFromKitware --- tribits/core/utils/TribitsSetCacheVarAndDefault.cmake | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake b/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake index 920341755..a90c45aad 100644 --- a/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake +++ b/tribits/core/utils/TribitsSetCacheVarAndDefault.cmake @@ -57,12 +57,8 @@ include_guard() macro(tribits_advanced_set_cache_var_and_default cacheVarName cacheVarType defaultDefaultVal docString ) - if ("${${cacheVarName}_DEFAULT}" STREQUAL "") - set(${cacheVarName}_DEFAULT "${defaultDefaultVal}") - endif() - set(${cacheVarName} "${${cacheVarName}_DEFAULT}" - CACHE ${cacheVarType} - "${docString}" ) + tribits_set_cache_var_and_default("${cacheVarName}" "${cacheVarType}" + "${defaultDefaultVal}" "${docString}") mark_as_advanced(${cacheVarName}) endmacro()