Browse Source

QtAutogen: Inline single use variable definitions

Sebastian Holtermann 9 years ago
parent
commit
d9996aab74
1 changed files with 5 additions and 8 deletions
  1. 5 8
      Source/cmQtAutoGeneratorInitializer.cxx

+ 5 - 8
Source/cmQtAutoGeneratorInitializer.cxx

@@ -115,17 +115,14 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
   for (std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
        fileIt != srcFiles.end(); ++fileIt) {
     cmSourceFile* sf = *fileIt;
-    std::string absFile = cmsys::SystemTools::GetRealPath(sf->GetFullPath());
-    bool skipFileForMoc =
-      cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
-    bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
+    const std::string absFile =
+      cmsys::SystemTools::GetRealPath(sf->GetFullPath());
+    const std::string ext = sf->GetExtension();
 
     if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOUIC"))) {
       skipUic.push_back(absFile);
     }
 
-    std::string ext = sf->GetExtension();
-
     if (target->GetPropertyAsBool("AUTORCC")) {
       if (ext == "qrc" &&
           !cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTORCC"))) {
@@ -146,8 +143,8 @@ static void SetupSourceFiles(cmGeneratorTarget const* target,
       }
     }
 
-    if (!generated) {
-      if (skipFileForMoc) {
+    if (!cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"))) {
+      if (cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"))) {
         skipMoc.push_back(absFile);
       } else {
         cmSystemTools::FileFormat fileType =