소스 검색

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.
Matthew Woehlke 9 년 전
부모
커밋
f45c16e7ee
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Source/cmExportFileGenerator.cxx

+ 3 - 0
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"