diff options
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 758466b..cab59fe 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) { |