diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-12-02 20:43:15 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-12-02 20:43:15 (GMT) |
commit | c207f5d3616efacdc4d91217f90609fd3679f116 (patch) | |
tree | 42669da76f3e27b70e6024c05599b9236f0062c4 /Source/cmQtAutomoc.cxx | |
parent | 9c0df72dc4b4e9403a3516390bc59f971ad1c3de (diff) | |
download | CMake-c207f5d3616efacdc4d91217f90609fd3679f116.zip CMake-c207f5d3616efacdc4d91217f90609fd3679f116.tar.gz CMake-c207f5d3616efacdc4d91217f90609fd3679f116.tar.bz2 |
automoc: also accept other files when .moc is included in non-strict mode
Alex
Diffstat (limited to 'Source/cmQtAutomoc.cxx')
-rw-r--r-- | Source/cmQtAutomoc.cxx | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 123cf67..79ee35b 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -675,28 +675,22 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, std::string fileToMoc = absFilename; if (basename != scannedFileBasename) { - bool fail = true; - if (basename == scannedFileBasename+"_p") + std::string mocSubDir = extractSubDir(absPath, currentMoc); + std::string headerToMoc = findMatchingHeader( + absPath, mocSubDir, basename, headerExtensions); + if (!headerToMoc.empty()) { - std::string mocSubDir = extractSubDir(absPath, currentMoc); - std::string headerToMoc = findMatchingHeader( - absPath, mocSubDir, basename, headerExtensions); - if (!headerToMoc.empty()) - { - // this is for KDE4 compatibility: - fail = false; - fileToMoc = headerToMoc; - std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " - "includes the moc file \"" << currentMoc << - "\" instead of \"moc_" << basename << ".cpp\". " - "Running moc on " - << "\"" << headerToMoc << "\" ! Better include \"moc_" - << basename << ".cpp\" for a robust build.\n" - << std::endl; - } + // this is for KDE4 compatibility: + fileToMoc = headerToMoc; + std::cerr << "AUTOMOC: warning: " << absFilename << ": The file " + "includes the moc file \"" << currentMoc << + "\" instead of \"moc_" << basename << ".cpp\". " + "Running moc on " + << "\"" << headerToMoc << "\" ! Better include \"moc_" + << basename << ".cpp\" for a robust build.\n" + << std::endl; } - - if (fail) + else { std::cerr <<"AUTOMOC: error: " << absFilename << ": The file " "includes the moc file \"" << currentMoc << |