summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenerators.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-19 13:57:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-19 13:59:17 (GMT)
commit091b649e198bade6fba7518b6c970bfa23b7365f (patch)
tree69ab88dcdd11d363e3353372fd1a16dc42f3c2f5 /Source/cmQtAutoGenerators.cxx
parent9beb2744d7685fca9cd5717308d4457dffdefcdc (diff)
downloadCMake-091b649e198bade6fba7518b6c970bfa23b7365f.zip
CMake-091b649e198bade6fba7518b6c970bfa23b7365f.tar.gz
CMake-091b649e198bade6fba7518b6c970bfa23b7365f.tar.bz2
Revert "Automoc: Fix support of files with the same name (#12873)"
This reverts commit 9beb2744d7685fca9cd5717308d4457dffdefcdc. Our AUTOMOC documentation states that it should be possible to `#include "moc_foo.cpp"` in `foo.cpp`, and this will not work if the file is placed in a different directory. Another solution will need to be found to the original problem. Reported-by: Stephen Kelly <steveire@gmail.com>
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r--Source/cmQtAutoGenerators.cxx35
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))
{