summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-30 20:02:58 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-30 20:02:58 (GMT)
commit7e5c571cce1a0d5d4b9d8eadaf35b73f7a2b72ed (patch)
treefab5be97d8a5d5682304f0140fefad83abe02117 /Source/cmGlobalVisualStudioGenerator.cxx
parentcc8c4a3f4fdc92a40d0ae5def0a113f860d11a8f (diff)
downloadCMake-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/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx28
1 files changed, 28 insertions, 0 deletions
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);
+ }
+}