diff options
author | Brad King <brad.king@kitware.com> | 2009-09-30 20:02:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-30 20:02:58 (GMT) |
commit | 7e5c571cce1a0d5d4b9d8eadaf35b73f7a2b72ed (patch) | |
tree | fab5be97d8a5d5682304f0140fefad83abe02117 /Source | |
parent | cc8c4a3f4fdc92a40d0ae5def0a113f860d11a8f (diff) | |
download | CMake-7e5c571cce1a0d5d4b9d8eadaf35b73f7a2b72ed.zip CMake-7e5c571cce1a0d5d4b9d8eadaf35b73f7a2b72ed.tar.gz CMake-7e5c571cce1a0d5d4b9d8eadaf35b73f7a2b72ed.tar.bz2 |
Move OrderedTargetDependSet into VS superclass
We move cmGlobalVisualStudio7Generator::OrderedTargetDependSet up to
cmGlobalVisualStudioGenerator so it can be re-used for other VS
versions. See issue #9568.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 28 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 11 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 11 |
4 files changed, 39 insertions, 39 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index c690882..0cc72ca 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -659,34 +659,6 @@ bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project, } //---------------------------------------------------------------------------- -bool -cmGlobalVisualStudio7Generator::TargetCompare -::operator()(cmTarget const* l, cmTarget const* r) -{ - // Make sure ALL_BUILD is first so it is the default active project. - if(strcmp(r->GetName(), "ALL_BUILD") == 0) - { - return false; - } - if(strcmp(l->GetName(), "ALL_BUILD") == 0) - { - return true; - } - return strcmp(l->GetName(), r->GetName()) < 0; -} - -//---------------------------------------------------------------------------- -cmGlobalVisualStudio7Generator::OrderedTargetDependSet -::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets) -{ - for(cmGlobalGenerator::TargetDependSet::const_iterator ti = - targets.begin(); ti != targets.end(); ++ti) - { - this->insert(*ti); - } -} - -//---------------------------------------------------------------------------- static cmVS7FlagTable cmVS7ExtraFlagTable[] = { // Precompiled header and related options. Note that the diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 9188726..363489e 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -92,11 +92,6 @@ public: ///! What is the configurations directory variable called? virtual const char* GetCMakeCFGInitDirectory() { return "$(OutDir)"; } - struct TargetCompare - { - bool operator()(cmTarget const* l, cmTarget const* r); - }; - protected: virtual const char* GetIDEVersion() { return "7.0"; } @@ -116,12 +111,6 @@ protected: virtual void WriteSLNHeader(std::ostream& fout); virtual void AddPlatformDefinitions(cmMakefile* mf); - class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare> - { - public: - OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&); - }; - virtual void WriteTargetsToSolution( std::ostream& fout, cmLocalGenerator* root, diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index f8c5575..bc67151 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -726,3 +726,31 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(cmTarget& target) } return false; } + +//---------------------------------------------------------------------------- +bool +cmGlobalVisualStudioGenerator::TargetCompare +::operator()(cmTarget const* l, cmTarget const* r) const +{ + // Make sure ALL_BUILD is first so it is the default active project. + if(strcmp(r->GetName(), "ALL_BUILD") == 0) + { + return false; + } + if(strcmp(l->GetName(), "ALL_BUILD") == 0) + { + return true; + } + return strcmp(l->GetName(), r->GetName()) < 0; +} + +//---------------------------------------------------------------------------- +cmGlobalVisualStudioGenerator::OrderedTargetDependSet +::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets) +{ + for(cmGlobalGenerator::TargetDependSet::const_iterator ti = + targets.begin(); ti != targets.end(); ++ti) + { + this->insert(*ti); + } +} diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 601836d..c601cc4 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -74,6 +74,17 @@ protected: virtual bool VSLinksDependencies() const { return true; } virtual const char* GetIDEVersion() = 0; + + struct TargetCompare + { + bool operator()(cmTarget const* l, cmTarget const* r) const; + }; + class OrderedTargetDependSet: public std::multiset<cmTarget*, TargetCompare> + { + public: + OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&); + }; + private: void FixUtilityDependsForTarget(cmTarget& target); void CreateUtilityDependTarget(cmTarget& target); |