Remove the need to check for .h/.cxx during buildtime
Instead it now relies on cmake time to put that information correctly into AutomocInfo.cmake Alex
This commit is contained in:
parent
d65689a3bd
commit
de91feb367
|
@ -73,6 +73,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
|
|||
|
||||
this->QtMajorVersion = makefile->GetSafeDefinition("AM_QT_VERSION_MAJOR");
|
||||
this->Sources = makefile->GetSafeDefinition("AM_SOURCES");
|
||||
this->Headers = makefile->GetSafeDefinition("AM_HEADERS");
|
||||
this->IncludeProjectDirsBefore = makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE");
|
||||
this->Srcdir = makefile->GetSafeDefinition("AM_CMAKE_CURRENT_SOURCE_DIR");
|
||||
this->Builddir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR");
|
||||
|
@ -282,11 +283,7 @@ bool cmQtAutomoc::RunAutomocQt4()
|
|||
{
|
||||
printf("Checking -%s-\n", absFilename.c_str());
|
||||
}
|
||||
std::string extension = absFilename.substr(absFilename.find_last_of('.'));
|
||||
|
||||
if (extension == ".cpp" || extension == ".cc" || extension == ".mm"
|
||||
|| extension == ".cxx" || extension == ".C")
|
||||
{
|
||||
const std::string contentsString = this->ReadAll(absFilename);
|
||||
if (contentsString.empty())
|
||||
{
|
||||
|
@ -440,9 +437,18 @@ bool cmQtAutomoc::RunAutomocQt4()
|
|||
} while(mocIncludeRegExp.find(contentsString.c_str() + matchOffset));
|
||||
}
|
||||
}
|
||||
else if (extension == ".h" || extension == ".hpp"
|
||||
|| extension == ".hxx" || extension == ".H")
|
||||
|
||||
std::vector<std::string> headerFiles;
|
||||
cmSystemTools::ExpandListArgument(this->Headers, headerFiles);
|
||||
for (std::vector<std::string>::const_iterator it = headerFiles.begin();
|
||||
it != headerFiles.end();
|
||||
++it)
|
||||
{
|
||||
const std::string &absFilename = *it;
|
||||
if (this->Verbose)
|
||||
{
|
||||
printf("Checking -%s-\n", absFilename.c_str());
|
||||
}
|
||||
if (includedMocs.find(absFilename) == includedMocs.end()
|
||||
&& notIncludedMocs.find(absFilename) == notIncludedMocs.end())
|
||||
{
|
||||
|
@ -454,14 +460,6 @@ bool cmQtAutomoc::RunAutomocQt4()
|
|||
notIncludedMocs[absFilename] = currentMoc;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->Verbose)
|
||||
{
|
||||
std::cout << "automoc4: ignoring file '" << absFilename << "' with unknown suffix" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// run moc on all the moc's that are #included in source files
|
||||
for(std::map<std::string, std::string>::const_iterator it = includedMocs.begin();
|
||||
|
|
|
@ -32,6 +32,7 @@ private:
|
|||
|
||||
std::string QtMajorVersion;
|
||||
std::string Sources;
|
||||
std::string Headers;
|
||||
bool IncludeProjectDirsBefore;
|
||||
std::string Srcdir;
|
||||
std::string Builddir;
|
||||
|
|
Loading…
Reference in New Issue