summaryrefslogtreecommitdiff
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-01-24 17:01:59 +0100
committerStephen Kelly <steveire@gmail.com>2014-01-28 21:04:40 +0100
commitf7ae1d8ad6d0db2b6656ed77f7de12189badf05c (patch)
treec45b1921831766ea0242d769e28e915b4dbf47a7 /Source/cmQtAutoGenerators.cxx
parent4b989d5f158e5135bf543438af00b03db0102ade (diff)
downloadcmake-f7ae1d8ad6d0db2b6656ed77f7de12189badf05c.tar.gz
QtAutogen: Short-circut some logic when moc is not available.
This is the case when AUTOMOC is false. This prevents creating rules to moc the files in the absense of moc.
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 758466b2ef..cab59fe830 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1444,6 +1444,12 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
<< std::endl;
return;
}
+ this->ParseForUic(absFilename, contentsString, includedUis);
+ if (this->MocExecutable.empty())
+ {
+ return;
+ }
+
const std::string absPath = cmsys::SystemTools::GetFilenamePath(
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
const std::string scannedFileBasename = cmsys::SystemTools::
@@ -1572,7 +1578,6 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
matchOffset += mocIncludeRegExp.end();
} while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
}
- this->ParseForUic(absFilename, contentsString, includedUis);
// In this case, check whether the scanned file itself contains a Q_OBJECT.
// If this is the case, the moc_foo.cpp should probably be generated from
@@ -1627,6 +1632,12 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
<< std::endl;
return;
}
+ this->ParseForUic(absFilename, contentsString, includedUis);
+ if (this->MocExecutable.empty())
+ {
+ return;
+ }
+
const std::string absPath = cmsys::SystemTools::GetFilenamePath(
cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/';
const std::string scannedFileBasename = cmsys::SystemTools::
@@ -1705,7 +1716,6 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
matchOffset += mocIncludeRegExp.end();
} while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
}
- this->ParseForUic(absFilename, contentsString, includedUis);
// In this case, check whether the scanned file itself contains a Q_OBJECT.
// If this is the case, the moc_foo.cpp should probably be generated from
@@ -1830,7 +1840,8 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders,
const std::string& headerName = *hIt;
const std::string contents = ReadAll(headerName);
- if (includedMocs.find(headerName) == includedMocs.end())
+ if (!this->MocExecutable.empty()
+ && includedMocs.find(headerName) == includedMocs.end())
{
if (this->Verbose)
{