diff options
author | Alex Neundorf <neundorf@kde.org> | 2013-02-10 16:58:29 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2013-02-10 17:10:20 (GMT) |
commit | 27e14a813cd399db778485961c0e66bd5cf488d6 (patch) | |
tree | bf520658ae158f0bdda38cdca7459aad55272685 /Source/cmQtAutomoc.cxx | |
parent | 10511aa0849936df3724556f1f42fc3e4cf43f9f (diff) | |
download | CMake-27e14a813cd399db778485961c0e66bd5cf488d6.zip CMake-27e14a813cd399db778485961c0e66bd5cf488d6.tar.gz CMake-27e14a813cd399db778485961c0e66bd5cf488d6.tar.bz2 |
automoc: use the header extensions from cmMakefile
Instead of having an own set of C header extensions, use
cmMakefile::GetHeaderExtensions() (#13904)
Alex
Diffstat (limited to 'Source/cmQtAutomoc.cxx')
-rw-r--r-- | Source/cmQtAutomoc.cxx | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 8a2d308..4818f1b 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -51,7 +51,7 @@ static std::string findMatchingHeader(const std::string& absPath, ext != headerExtensions.end(); ++ext) { - std::string sourceFilePath = absPath + basename + (*ext); + std::string sourceFilePath = absPath + basename + "." + (*ext); if (cmsys::SystemTools::FileExists(sourceFilePath.c_str())) { header = sourceFilePath; @@ -59,7 +59,7 @@ static std::string findMatchingHeader(const std::string& absPath, } if (!mocSubDir.empty()) { - sourceFilePath = mocSubDir + basename + (*ext); + sourceFilePath = mocSubDir + basename + "." + (*ext); if (cmsys::SystemTools::FileExists(sourceFilePath.c_str())) { header = sourceFilePath; @@ -296,7 +296,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory) if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") { - success = this->RunAutomoc(); + success = this->RunAutomoc(makefile); } this->WriteOldMocDefinitionsFile(targetDirectory); @@ -504,7 +504,7 @@ void cmQtAutomoc::Init() } -bool cmQtAutomoc::RunAutomoc() +bool cmQtAutomoc::RunAutomoc(cmMakefile* makefile) { if (!cmsys::SystemTools::FileExists(this->OutMocCppFilename.c_str()) || (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr)) @@ -528,22 +528,8 @@ bool cmQtAutomoc::RunAutomoc() std::vector<std::string> sourceFiles; cmSystemTools::ExpandListArgument(this->Sources, sourceFiles); - std::vector<std::string> headerExtensions; - headerExtensions.push_back(".h"); - headerExtensions.push_back(".hpp"); - headerExtensions.push_back(".hxx"); -#if defined(_WIN32) - // not case sensitive, don't add ".H" -#elif defined(__APPLE__) - // detect case-sensitive filesystem - long caseSensitive = pathconf(this->Srcdir.c_str(), _PC_CASE_SENSITIVE); - if (caseSensitive == 1) - { - headerExtensions.push_back(".H"); - } -#else - headerExtensions.push_back(".H"); -#endif + const std::vector<std::string>& headerExtensions = + makefile->GetHeaderExtensions(); for (std::vector<std::string>::const_iterator it = sourceFiles.begin(); it != sourceFiles.end(); @@ -945,7 +931,7 @@ void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename, ext != headerExtensions.end(); ++ext) { - const std::string headerName = absPath + basename + (*ext); + const std::string headerName = absPath + basename + "." + (*ext); if (cmsys::SystemTools::FileExists(headerName.c_str())) { absHeaders.insert(headerName); @@ -956,7 +942,7 @@ void cmQtAutomoc::SearchHeadersForCppFile(const std::string& absFilename, ext != headerExtensions.end(); ++ext) { - const std::string privateHeaderName = absPath+basename+"_p"+(*ext); + const std::string privateHeaderName = absPath+basename+"_p."+(*ext); if (cmsys::SystemTools::FileExists(privateHeaderName.c_str())) { absHeaders.insert(privateHeaderName); @@ -1090,7 +1076,7 @@ std::string cmQtAutomoc::Join(const std::vector<std::string>& lst, it != lst.end(); ++it) { - result += (*it) + separator; + result += "." + (*it) + separator; } result.erase(result.end() - 1); return result; |