Record which files are skipped by automoc.

They may not be skipped by autouic.
This commit is contained in:
Stephen Kelly 2013-10-11 15:04:15 +02:00
parent 18fb7588df
commit 94a0ca604c
2 changed files with 27 additions and 12 deletions

View File

@ -1,4 +1,5 @@
set(AM_SOURCES @_moc_files@ )
set(AM_SKIP_MOC @_skip_moc@ )
set(AM_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_INCLUDES @_moc_incs@)

View File

@ -379,6 +379,9 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
const std::vector<cmSourceFile*>& srcFiles = target->GetSourceFiles();
std::string skip_moc;
const char *sep = "";
for(std::vector<cmSourceFile*>::const_iterator fileIt = srcFiles.begin();
fileIt != srcFiles.end();
++fileIt)
@ -389,7 +392,15 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
if ((skip==false) && (generated == false))
if (!generated)
{
if (skip)
{
skip_moc += sep;
skip_moc += absFile;
sep = ";";
}
else
{
std::string ext = sf->GetExtension();
cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
@ -408,6 +419,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
}
}
}
}
const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
std::string _moc_options = (tmp!=0 ? tmp : "");
@ -415,6 +427,8 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget* target,
cmLocalGenerator::EscapeForCMake(_moc_options.c_str()).c_str());
makefile->AddDefinition("_moc_files",
cmLocalGenerator::EscapeForCMake(_moc_files.c_str()).c_str());
makefile->AddDefinition("_skip_moc",
cmLocalGenerator::EscapeForCMake(skip_moc.c_str()).c_str());
makefile->AddDefinition("_moc_headers",
cmLocalGenerator::EscapeForCMake(_moc_headers.c_str()).c_str());
bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE");