Commit 94a0ca60 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Record which files are skipped by automoc.

They may not be skipped by autouic.
parent 18fb7588
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@)
......
......@@ -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,22 +392,31 @@ 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)
{
std::string ext = sf->GetExtension();
cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
ext.c_str());
if (fileType == cmSystemTools::CXX_FILE_FORMAT)
if (skip)
{
_moc_files += sepFiles;
_moc_files += absFile;
sepFiles = ";";
skip_moc += sep;
skip_moc += absFile;
sep = ";";
}
else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
else
{
_moc_headers += sepHeaders;
_moc_headers += absFile;
sepHeaders = ";";
std::string ext = sf->GetExtension();
cmSystemTools::FileFormat fileType = cmSystemTools::GetFileFormat(
ext.c_str());
if (fileType == cmSystemTools::CXX_FILE_FORMAT)
{
_moc_files += sepFiles;
_moc_files += absFile;
sepFiles = ";";
}
else if (fileType == cmSystemTools::HEADER_FILE_FORMAT)
{
_moc_headers += sepHeaders;
_moc_headers += absFile;
sepHeaders = ";";
}
}
}
}
......@@ -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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment