Browse Source

Don't write a comment in the export file without the code.

Stephen Kelly 12 years ago
parent
commit
f623d37a95
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Source/cmExportFileGenerator.cxx

+ 4 - 0
Source/cmExportFileGenerator.cxx

@@ -665,6 +665,10 @@ cmExportFileGenerator
 void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
 void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
                                 const std::vector<std::string>& missingTargets)
                                 const std::vector<std::string>& missingTargets)
 {
 {
+  if (missingTargets.empty())
+    {
+    return;
+    }
   os << "# Make sure the targets which have been exported in some other \n"
   os << "# Make sure the targets which have been exported in some other \n"
         "# export set exist.\n";
         "# export set exist.\n";
   for(unsigned int i=0; i<missingTargets.size(); ++i)
   for(unsigned int i=0; i<missingTargets.size(); ++i)