diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-11 13:04:15 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-10-24 09:50:58 (GMT) |
commit | 94a0ca604ca6ba3699b6d309938e881b2a3984a0 (patch) | |
tree | a899c65e548f2b58a8d7f5677f7dcf060992b372 | |
parent | 18fb7588df5b380340423eb36a90a7aefc1fa6ca (diff) | |
download | CMake-94a0ca604ca6ba3699b6d309938e881b2a3984a0.zip CMake-94a0ca604ca6ba3699b6d309938e881b2a3984a0.tar.gz CMake-94a0ca604ca6ba3699b6d309938e881b2a3984a0.tar.bz2 |
Record which files are skipped by automoc.
They may not be skipped by autouic.
-rw-r--r-- | Modules/AutogenInfo.cmake.in | 1 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 38 |
2 files changed, 27 insertions, 12 deletions
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in index 9cff735..19663ff 100644 --- a/Modules/AutogenInfo.cmake.in +++ b/Modules/AutogenInfo.cmake.in @@ -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@) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 656bb0c..7f8d283 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -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"); |