diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in index 84b0f4d2d9..3fafaff119 100644 --- a/Modules/AutogenInfo.cmake.in +++ b/Modules/AutogenInfo.cmake.in @@ -1,7 +1,7 @@ -set(AM_SOURCES @_cpp_files@ ) -set(AM_SKIP_MOC @_skip_moc@ ) -set(AM_SKIP_UIC @_skip_uic@ ) -set(AM_HEADERS @_moc_headers@ ) +set(AM_SOURCES @_moc_uic_sources@) +set(AM_HEADERS @_moc_uic_headers@) +set(AM_SKIP_MOC @_skip_moc@) +set(AM_SKIP_UIC @_skip_uic@) set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) set(AM_MOC_INCLUDES @_moc_incs@) set(AM_MOC_OPTIONS @_moc_options@) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 0ed43b1d6b..5304aece1d 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -99,9 +99,9 @@ static std::string GetQtMajorVersion(cmGeneratorTarget const* target) } static void SetupSourceFiles(cmGeneratorTarget const* target, + std::vector& mocUicSources, + std::vector& mocUicHeaders, std::vector& skipMoc, - std::vector& sources, - std::vector& headers, std::vector& skipUic) { cmMakefile* makefile = target->Target->GetMakefile(); @@ -136,9 +136,9 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, cmsys::SystemTools::GetRealPath(sf->GetFullPath()); // Add file name to sources or headers list if (fileType == cmSystemTools::CXX_FILE_FORMAT) { - sources.push_back(absFile); + mocUicSources.push_back(absFile); } else if (fileType == cmSystemTools::HEADER_FILE_FORMAT) { - headers.push_back(absFile); + mocUicHeaders.push_back(absFile); } // Add file name to skip lists on demand if (fileSkipUic) { @@ -171,7 +171,6 @@ static void GetCompileDefinitionsAndDirectories( static void MocSetupAutoTarget( cmGeneratorTarget const* target, const std::string& autogenTargetName, std::vector const& skipMoc, - std::vector const& mocHeaders, std::map& configIncludes, std::map& configDefines) { @@ -185,9 +184,6 @@ static void MocSetupAutoTarget( makefile->AddDefinition( "_skip_moc", cmOutputConverter::EscapeForCMake(cmJoin(skipMoc, ";")).c_str()); - makefile->AddDefinition( - "_moc_headers", - cmOutputConverter::EscapeForCMake(cmJoin(mocHeaders, ";")).c_str()); bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); @@ -863,10 +859,10 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( cmOutputConverter::EscapeForCMake(target->GetName()).c_str()); makefile->AddDefinition("_target_qt_version", qtMajorVersion.c_str()); - std::vector skipUic; + std::vector mocUicSources; + std::vector mocUicHeaders; std::vector skipMoc; - std::vector mocSources; - std::vector mocHeaders; + std::vector skipUic; std::map configMocIncludes; std::map configMocDefines; std::map configUicOptions; @@ -874,14 +870,18 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget( if (target->GetPropertyAsBool("AUTOMOC") || target->GetPropertyAsBool("AUTOUIC") || target->GetPropertyAsBool("AUTORCC")) { - SetupSourceFiles(target, skipMoc, mocSources, mocHeaders, skipUic); + SetupSourceFiles(target, mocUicSources, mocUicHeaders, skipMoc, skipUic); } makefile->AddDefinition( - "_cpp_files", - cmOutputConverter::EscapeForCMake(cmJoin(mocSources, ";")).c_str()); + "_moc_uic_sources", + cmOutputConverter::EscapeForCMake(cmJoin(mocUicSources, ";")).c_str()); + makefile->AddDefinition( + "_moc_uic_headers", + cmOutputConverter::EscapeForCMake(cmJoin(mocUicHeaders, ";")).c_str()); + if (target->GetPropertyAsBool("AUTOMOC")) { - MocSetupAutoTarget(target, autogenTargetName, skipMoc, mocHeaders, - configMocIncludes, configMocDefines); + MocSetupAutoTarget(target, autogenTargetName, skipMoc, configMocIncludes, + configMocDefines); } if (target->GetPropertyAsBool("AUTOUIC")) { UicSetupAutoTarget(target, skipUic, configUicOptions);