diff options
author | Brad King <brad.king@kitware.com> | 2016-02-24 14:39:08 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-02-24 14:39:08 (GMT) |
commit | be98577f13299456804f619f46dc5a0560bcb176 (patch) | |
tree | fb9b790bec73ffdaad480231d429907032041eff /Source | |
parent | 3dd42fe4eb600339222c42ed440b37a3d76128d6 (diff) | |
parent | 091b649e198bade6fba7518b6c970bfa23b7365f (diff) | |
download | CMake-be98577f13299456804f619f46dc5a0560bcb176.zip CMake-be98577f13299456804f619f46dc5a0560bcb176.tar.gz CMake-be98577f13299456804f619f46dc5a0560bcb176.tar.bz2 |
Merge topic 'revert-automoc-src-per-dir'
091b649e Revert "Automoc: Fix support of files with the same name (#12873)"
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 226ab43..b16eccd 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1104,39 +1104,10 @@ void cmQtAutoGenerators::ParseHeaders(const std::set<std::string>& absHeaders, std::cout << "AUTOGEN: Checking " << headerName << std::endl; } - std::string headerDirectory; - if (cmsys::SystemTools::IsSubDirectory(headerName, - this->ProjectSourceDir)) - { - headerDirectory = this->ProjectSourceDir; - } - else if (cmsys::SystemTools::IsSubDirectory(headerName, - this->ProjectBinaryDir)) - { - headerDirectory = this->ProjectBinaryDir; - } - else - { - cmsys::SystemTools::SplitPathRootComponent(headerName, - &headerDirectory); - } - - std::string baseHeaderName = - cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName); - - headerDirectory = cmsys::SystemTools::RelativePath( - headerDirectory, cmsys::SystemTools::GetParentDirectory(headerName)); - - if (!headerDirectory.empty()) - { - headerDirectory += "/"; - } - - std::string mocName = headerDirectory + baseHeaderName; - - cmSystemTools::ReplaceString(mocName, "/", "_"); + const std::string basename = cmsys::SystemTools:: + GetFilenameWithoutLastExtension(headerName); - const std::string currentMoc = "moc_" + mocName + ".cpp"; + const std::string currentMoc = "moc_" + basename + ".cpp"; std::string macroName; if (requiresMocing(contents, macroName)) { |