From f7ae1d8ad6d0db2b6656ed77f7de12189badf05c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 24 Jan 2014 17:01:59 +0100 Subject: 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. --- Source/cmQtAutoGenerators.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Source/cmQtAutoGenerators.cxx') 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& 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) { -- cgit v1.2.1