Merge branch 'autogen-moc-predefs-no-moc-options' into release-3.10

Merge-request: !1432
This commit is contained in:
Brad King 2017-10-31 10:18:14 -04:00
commit 1df31aa92a
2 changed files with 12 additions and 3 deletions

View File

@ -1392,9 +1392,13 @@ bool cmQtAutoGenerators::MocGenerateAll()
{
// Compose command
std::vector<std::string> cmd = this->MocPredefsCmd;
// Add options
cmd.insert(cmd.end(), this->MocAllOptions.begin(),
this->MocAllOptions.end());
// Add includes
cmd.insert(cmd.end(), this->MocIncludes.begin(),
this->MocIncludes.end());
// Add definitions
for (std::string const& def : this->MocDefinitions) {
cmd.push_back("-D" + def);
}
// Execute command
if (!this->RunCommand(cmd, output)) {
this->LogCommandError(cmQtAutoGen::MOC,

View File

@ -65,6 +65,11 @@ add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySo
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
add_executable(mocOnlyOpts mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp)
set_property(TARGET mocOnlyOpts PROPERTY AUTOMOC ON)
set_property(TARGET mocOnlyOpts PROPERTY AUTOMOC_MOC_OPTIONS "-nw")
target_link_libraries(mocOnlyOpts ${QT_LIBRARIES})
# -- Test
# UIC only
if(ALLOW_WRAP_CPP)