From 1e3542dd2f39b06b9523200559908a33b1fe2b18 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 22 Oct 2021 09:31:20 -0600 Subject: [PATCH] Replace manual include guards with include_guard() (#411) --- .../package_arch/TribitsReportInvalidTribitsUsage.cmake | 6 +----- .../TribitsTplFindIncludeDirsAndLibraries.cmake | 6 +----- tribits/core/utils/MessageWrapper.cmake | 6 +----- tribits/core/utils/PrintVar.cmake | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake b/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake index 4db279fd3..442a4928f 100644 --- a/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake +++ b/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake @@ -37,11 +37,7 @@ # ************************************************************************ # @HEADER -if (__TribitsReportInvalidTribitsUsage_INCLUDED__) - return() -else() - set(__TribitsReportInvalidTribitsUsage_INCLUDED__ TRUE) -endif() +include_guard() include(MessageWrapper) diff --git a/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake b/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake index dfcedc290..c8c1f01fb 100644 --- a/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake +++ b/tribits/core/package_arch/TribitsTplFindIncludeDirsAndLibraries.cmake @@ -37,11 +37,7 @@ # ************************************************************************ # @HEADER -if (TribitsTplFindIncludeDirsAndLibraries_INCLUDED) - return() -else() - set(TribitsTplFindIncludeDirsAndLibraries_INCLUDED TRUE) -endif() +include_guard() include(AdvancedSet) include(AppendSet) diff --git a/tribits/core/utils/MessageWrapper.cmake b/tribits/core/utils/MessageWrapper.cmake index 59b17d13a..cf7a0723d 100644 --- a/tribits/core/utils/MessageWrapper.cmake +++ b/tribits/core/utils/MessageWrapper.cmake @@ -37,14 +37,10 @@ # ************************************************************************ # @HEADER -if (MESSAGE_WRAPPER_INCLUDED) - return() -endif() -set(MESSAGE_WRAPPER_INCLUDED TRUE) +include_guard() include(GlobalSet) -# # @FUNCTION: message_wrapper() # # Function that wraps the standard CMake/CTest ``message()`` function call in diff --git a/tribits/core/utils/PrintVar.cmake b/tribits/core/utils/PrintVar.cmake index 7b60a9b0c..bf0290aa1 100644 --- a/tribits/core/utils/PrintVar.cmake +++ b/tribits/core/utils/PrintVar.cmake @@ -37,12 +37,8 @@ # ************************************************************************ # @HEADER -if (PRINT_VAR_INCLUDED) - return() -endif() -set(PRINT_VAR_INCLUDED TRUE) +include_guard() -# # @FUNCTION: print_var() # # Unconditionally print a variable giving its name then value.