From d9a6e0ffc82fbc460289c6b0808eff27ac316235 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sat, 10 Sep 2022 18:22:18 +1000 Subject: FetchContent: Fix unsetting wrong variable name after provider returns The unset() command was using __cmake_contentNameLower before that variable was restored from the __cmake_fcCurrentVarsStack. That means if there had been a nested call to FetchContent_MakeAvailable(), the wrong variable name would have been cleared (the nested name instead of the one from the current call). That would have left the variable set upon return, blocking the dependency provider from seeing any further calls to FetchContent_MakeAvailable() in the current variable scope or below for the current dependency. --- Modules/FetchContent.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake index 20f0bd2..bb7e44d 100644 --- a/Modules/FetchContent.cmake +++ b/Modules/FetchContent.cmake @@ -1893,13 +1893,13 @@ macro(FetchContent_MakeAvailable) set(__cmake_fcProvider_${__cmake_contentNameLower} YES) cmake_language(EVAL CODE "${__cmake_providerCommand}(${__cmake_providerArgs})") - unset(__cmake_fcProvider_${__cmake_contentNameLower}) list(POP_BACK __cmake_fcCurrentVarsStack __cmake_contentNameLower __cmake_contentName ) + unset(__cmake_fcProvider_${__cmake_contentNameLower}) unset(__cmake_providerArgs) unset(__cmake_addfpargs) unset(__cmake_fpargs) -- cgit v0.12