diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-01 14:58:34 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-10 11:49:16 (GMT) |
commit | d58b6bf31c18cfedd4a2f15e009b8e5cbdc21b6e (patch) | |
tree | 936f7cab213ccad13d451f9204bb1f9e6f9e1661 | |
parent | 94c319f93309ff4cddd0280cdcbd48b50492db36 (diff) | |
download | CMake-d58b6bf31c18cfedd4a2f15e009b8e5cbdc21b6e.zip CMake-d58b6bf31c18cfedd4a2f15e009b8e5cbdc21b6e.tar.gz CMake-d58b6bf31c18cfedd4a2f15e009b8e5cbdc21b6e.tar.bz2 |
AUTOGEN: Generators: Moc/UicSkipTest methods
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 63 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.h | 3 |
2 files changed, 38 insertions, 28 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index fac9d54..9c8594b 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -610,16 +610,7 @@ void cmQtAutoGenerators::ParseContentForUic( const std::string& absFilename, const std::string& contentsString, std::map<std::string, std::vector<std::string> >& includedUis) { - if (this->UicExecutable.empty()) { - return; - } - // Check skip list - if (ListContains(this->SkipUic, absFilename)) { - if (this->Verbose) { - std::ostringstream err; - err << "AUTOUIC: Skipping " << absFilename << "\n"; - this->LogInfo(err.str()); - } + if (this->UicExecutable.empty() || this->UicSkipTest(absFilename)) { return; } @@ -653,16 +644,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( const std::vector<std::string>& headerExtensions, std::map<std::string, std::string>& includedMocs, bool relaxed) { - if (this->MocExecutable.empty()) { - return true; - } - // Check skip list - if (ListContains(this->SkipMoc, absFilename)) { - if (this->Verbose) { - std::ostringstream err; - err << "AUTOMOC: Skipping " << absFilename << "\n"; - this->LogInfo(err.str()); - } + if (this->MocExecutable.empty() || this->MocSkipTest(absFilename)) { return true; } @@ -921,14 +903,7 @@ void cmQtAutoGenerators::ParseHeaders( if (!this->MocExecutable.empty() && (absHeadersMoc.find(headerName) != absHeadersMoc.end()) && (includedMocs.find(headerName) == includedMocs.end())) { - if (ListContains(this->SkipMoc, headerName)) { - // Skip - if (this->Verbose) { - std::ostringstream err; - err << "AUTOMOC: Skipping " << headerName << "\n"; - this->LogInfo(err.str()); - } - } else { + if (!this->MocSkipTest(headerName)) { // Process if (this->Verbose) { std::ostringstream err; @@ -1397,6 +1372,38 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile, } /** + * @brief Tests if the file name is in the skip list + */ +bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename) +{ + if (ListContains(this->SkipMoc, absFilename)) { + if (this->Verbose) { + std::ostringstream msg; + msg << "AUTOMOC: Skipping " << absFilename << "\n"; + this->LogInfo(msg.str()); + } + return true; + } + return false; +} + +/** + * @brief Tests if the file name is in the skip list + */ +bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename) +{ + if (ListContains(this->SkipUic, absFilename)) { + if (this->Verbose) { + std::ostringstream msg; + msg << "AUTOUIC: Skipping " << absFilename << "\n"; + this->LogInfo(msg.str()); + } + return true; + } + return false; +} + +/** * @brief Collects name collisions as output/input pairs * @return True if there were collisions */ diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 1036cb7..d0c7066 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -86,6 +86,9 @@ private: void Init(); + bool MocSkipTest(const std::string& absFilename); + bool UicSkipTest(const std::string& absFilename); + bool NameCollisionTest(const std::map<std::string, std::string>& genFiles, std::multimap<std::string, std::string>& collisions); |