This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via ab944c0a09a165758f224c58fc1f2e6c4724c139 (commit) via 9c441d19d35d5717487a6ef725327dee91dd2cd4 (commit) from 6f5707c3e3f4e666f8d04fba1023597df825063a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab944c0a09a165758f224c58fc1f2e6c4724c139 commit ab944c0a09a165758f224c58fc1f2e6c4724c139 Merge: 6f5707c 9c441d1 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Feb 21 08:48:46 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Feb 21 08:48:46 2014 -0500 Merge topic 'target-SOURCES-refactor' into next 9c441d19 cmGeneratorTarget: Avoid function specialization http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c441d19d35d5717487a6ef725327dee91dd2cd4 commit 9c441d19d35d5717487a6ef725327dee91dd2cd4 Author: Brad King <brad.k...@kitware.com> AuthorDate: Fri Feb 21 08:48:07 2014 -0500 Commit: Brad King <brad.k...@kitware.com> CommitDate: Fri Feb 21 08:48:07 2014 -0500 cmGeneratorTarget: Avoid function specialization diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 38b6936..a7b2fb6 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -88,40 +88,36 @@ struct IsSameTag: public IsSameTagBase }; #endif -template<bool, typename T> -void doAccept(T&, cmSourceFile*) +template<bool> +struct DoAccept { -} - -template<> -void doAccept<true, - std::vector<cmSourceFile*> >(std::vector<cmSourceFile*>& files, - cmSourceFile* f) -{ - files.push_back(f); -} - -template<> -void doAccept<true, - cmGeneratorTarget::ResxData>(cmGeneratorTarget::ResxData& data, - cmSourceFile* f) -{ - // Build and save the name of the corresponding .h file - // This relationship will be used later when building the project files. - // Both names would have been auto generated from Visual Studio - // where the user supplied the file name and Visual Studio - // appended the suffix. - std::string resx = f->GetFullPath(); - std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h"; - data.ExpectedResxHeaders.insert(hFileName); - data.ResxSources.push_back(f); -} + template <typename T> static void Do(T&, cmSourceFile*) {} +}; template<> -void doAccept<true, std::string>(std::string& data, cmSourceFile* f) +struct DoAccept<true> { - data = f->GetFullPath(); -} + static void Do(std::vector<cmSourceFile*>& files, cmSourceFile* f) + { + files.push_back(f); + } + static void Do(cmGeneratorTarget::ResxData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string resx = f->GetFullPath(); + std::string hFileName = resx.substr(0, resx.find_last_of(".")) + ".h"; + data.ExpectedResxHeaders.insert(hFileName); + data.ResxSources.push_back(f); + } + static void Do(std::string& data, cmSourceFile* f) + { + data = f->GetFullPath(); + } +}; //---------------------------------------------------------------------------- template<typename Tag, typename DataType = std::vector<cmSourceFile*> > @@ -154,19 +150,19 @@ struct TagVisitor std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); if(sf->GetCustomCommand()) { - doAccept<IsSameTag<Tag, CustomCommandsTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, CustomCommandsTag>::Result>::Do(this->Data, sf); } else if(this->Target->GetType() == cmTarget::UTILITY) { - doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf); } else if(sf->GetPropertyAsBool("HEADER_FILE_ONLY")) { - doAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>::Do(this->Data, sf); } else if(sf->GetPropertyAsBool("EXTERNAL_OBJECT")) { - doAccept<IsSameTag<Tag, ExternalObjectsTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ExternalObjectsTag>::Result>::Do(this->Data, sf); if(this->IsObjLib) { this->BadObjLibFiles.push_back(sf); @@ -174,12 +170,12 @@ struct TagVisitor } else if(sf->GetLanguage()) { - doAccept<IsSameTag<Tag, ObjectSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ObjectSourcesTag>::Result>::Do(this->Data, sf); } else if(ext == "def") { - doAccept<IsSameTag<Tag, ModuleDefinitionFileTag>::Result>(this->Data, - sf); + DoAccept<IsSameTag<Tag, ModuleDefinitionFileTag>::Result>::Do(this->Data, + sf); if(this->IsObjLib) { this->BadObjLibFiles.push_back(sf); @@ -187,7 +183,7 @@ struct TagVisitor } else if(ext == "idl") { - doAccept<IsSameTag<Tag, IDLSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, IDLSourcesTag>::Result>::Do(this->Data, sf); if(this->IsObjLib) { this->BadObjLibFiles.push_back(sf); @@ -195,19 +191,19 @@ struct TagVisitor } else if(ext == "resx") { - doAccept<IsSameTag<Tag, ResxTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ResxTag>::Result>::Do(this->Data, sf); } else if(this->Header.find(sf->GetFullPath().c_str())) { - doAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, HeaderSourcesTag>::Result>::Do(this->Data, sf); } else if(this->GlobalGenerator->IgnoreFile(sf->GetExtension().c_str())) { - doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf); } else { - doAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>(this->Data, sf); + DoAccept<IsSameTag<Tag, ExtraSourcesTag>::Result>::Do(this->Data, sf); if(this->IsObjLib && ext != "txt") { this->BadObjLibFiles.push_back(sf); ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorTarget.cxx | 80 ++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 42 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits