From f45c16e7ee562f9918b75134b54b92661c5a98c8 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Thu, 5 May 2016 11:33:56 -0400 Subject: [PATCH] Fix export file variable pollution Add missing unset of scratch variables to generated export file for case that the file was already included. We already unset these when parsing the file normally, but the multiple inclusion case was leaving them around. --- Source/cmExportFileGenerator.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 2b3ce148c..89a8f6c78 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1040,6 +1040,9 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode(std::ostream& os, " endif()\n" "endforeach()\n" "if(\"${_targetsDefined}\" STREQUAL \"${_expectedTargets}\")\n" + " unset(_targetsDefined)\n" + " unset(_targetsNotDefined)\n" + " unset(_expectedTargets)\n" " set(CMAKE_IMPORT_FILE_VERSION)\n" " cmake_policy(POP)\n" " return()\n"