diff options
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 08749dd..18a2bca 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1243,6 +1243,7 @@ bool cmQtAutoGenerators::GenerateUiFiles( { // single map with input / output names std::map<std::string, std::map<std::string, std::string> > uiGenMap; + std::map<std::string, std::string> testMap; for(std::map<std::string, std::vector<std::string> >::const_iterator it = includedUis.begin(); it != includedUis.end(); ++it) { @@ -1260,9 +1261,24 @@ bool cmQtAutoGenerators::GenerateUiFiles( const std::string uiInputFile = sourcePath + uiFileName + ".ui"; const std::string uiOutputFile = "ui_" + uiFileName + ".h"; sourceMap[uiInputFile] = uiOutputFile; + testMap[uiInputFile] = uiOutputFile; } } + // look for name collisions + { + std::multimap<std::string, std::string> collisions; + if( this->NameCollisionTest ( testMap, collisions ) ) + { + std::cerr << "AUTOGEN: error: The same ui_NAME.h file will be generated " + "from different sources." << std::endl + << "To avoid this error rename the source files." << std::endl; + this->NameCollisionLog ( collisions ); + ::exit(EXIT_FAILURE); + } + } + testMap.clear(); + // generate ui files for(std::map<std::string, std::map<std::string, std::string> >:: const_iterator it = uiGenMap.begin(); it != uiGenMap.end(); ++it) |