Przeglądaj źródła

automoc: fix handling of included _p.moc files

Alex
Alex Neundorf 14 lat temu
rodzic
commit
8507eaed16
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      Source/cmQtAutomoc.cxx

+ 3 - 2
Source/cmQtAutomoc.cxx

@@ -663,6 +663,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
         }
         }
       else
       else
         {
         {
+        std::string fileToMoc = absFilename;
         if (basename != scannedFileBasename)
         if (basename != scannedFileBasename)
           {
           {
           bool fail = true;
           bool fail = true;
@@ -676,7 +677,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
               {
               {
               // this is for KDE4 compatibility:
               // this is for KDE4 compatibility:
               fail = false;
               fail = false;
-              includedMocs[headerToMoc] = currentMoc;
+              fileToMoc = headerToMoc;
               std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
               std::cerr << "AUTOMOC: warning: " << absFilename << ": The file "
                            "includes the moc file \"" << currentMoc <<
                            "includes the moc file \"" << currentMoc <<
                            "\" instead of \"moc_" << basename << ".cpp\". "
                            "\" instead of \"moc_" << basename << ".cpp\". "
@@ -703,7 +704,7 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename,
           dotMocIncluded = true;
           dotMocIncluded = true;
           ownDotMocFile = currentMoc;
           ownDotMocFile = currentMoc;
           }
           }
-        includedMocs[absFilename] = currentMoc;
+        includedMocs[fileToMoc] = currentMoc;
         }
         }
       matchOffset += mocIncludeRegExp.end();
       matchOffset += mocIncludeRegExp.end();
       } while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
       } while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));