diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-14 22:59:07 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-02-19 11:35:42 (GMT) |
commit | d3a9887149d638dd23df2b46ff67a90cd91d33fe (patch) | |
tree | c1c51ee592a6acf0e6a873398f2f6961411f4f1c /Source/cmQtAutoGenerators.cxx | |
parent | 6ae09b7c1473836236275e553fe9ff77f48306c1 (diff) | |
download | CMake-d3a9887149d638dd23df2b46ff67a90cd91d33fe.zip CMake-d3a9887149d638dd23df2b46ff67a90cd91d33fe.tar.gz CMake-d3a9887149d638dd23df2b46ff67a90cd91d33fe.tar.bz2 |
Autogen: Add method for checksum based path generation
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 218bbc3..0a90c7e 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1046,10 +1046,8 @@ void cmQtAutoGenerators::ParseHeaders( } std::string macroName; if (this->MocRequired(contents, macroName)) { - notIncludedMocs[headerName] = fpathCheckSum.getPart(headerName) + - "/moc_" + - cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName) + - ".cpp"; + notIncludedMocs[headerName] = + this->ChecksumedPath(headerName, "moc_", ".cpp"); } } @@ -1412,9 +1410,8 @@ bool cmQtAutoGenerators::RccGenerateAll() si != this->RccSources.end(); ++si) { const std::string ext = cmsys::SystemTools::GetFilenameLastExtension(*si); if (ext == ".qrc") { - qrcGenMap[*si] = this->AutogenBuildSubDir + fpathCheckSum.getPart(*si) + - "/qrc_" + cmsys::SystemTools::GetFilenameWithoutLastExtension(*si) + - ".cpp"; + qrcGenMap[*si] = + this->AutogenBuildSubDir + this->ChecksumedPath(*si, "qrc_", ".cpp"); } } @@ -1629,6 +1626,22 @@ bool cmQtAutoGenerators::NameCollisionTest( } /** + * @brief Generates a file path based on the checksum of the source file path + * @return The path + */ +std::string cmQtAutoGenerators::ChecksumedPath(const std::string& sourceFile, + const char* basePrefix, + const char* baseSuffix) +{ + std::string res = fpathCheckSum.getPart(sourceFile); + res += "/"; + res += basePrefix; + res += cmsys::SystemTools::GetFilenameWithoutLastExtension(sourceFile); + res += baseSuffix; + return res; +} + +/** * @brief Generates the parent directory of the given file on demand * @return True on success */ |