diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-04-18 18:32:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-22 12:49:21 (GMT) |
commit | 663d093d454902269a83d7f07c6546e773328086 (patch) | |
tree | 49d7c2fdf5382ca624562ad529f3cea63683a9c0 /Source | |
parent | 8295d43713b621558ce8fc67033021e6eb2a6612 (diff) | |
download | CMake-663d093d454902269a83d7f07c6546e773328086.zip CMake-663d093d454902269a83d7f07c6546e773328086.tar.gz CMake-663d093d454902269a83d7f07c6546e773328086.tar.bz2 |
Autogen: Check added for name collisions of generated ui_NAME.h files
Diffstat (limited to 'Source')
-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) |