summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio7Generator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-21 21:39:43 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-21 21:39:43 (GMT)
commit00ca96ae7c6950ebe8584f0b53ad88dc01a9605e (patch)
tree21961018fbe71c0b66da73c2c2aabbb4646f3598 /Source/cmGlobalVisualStudio7Generator.h
parent36c228814b18ef115a1a72cac4f103691f249569 (diff)
downloadCMake-00ca96ae7c6950ebe8584f0b53ad88dc01a9605e.zip
CMake-00ca96ae7c6950ebe8584f0b53ad88dc01a9605e.tar.gz
CMake-00ca96ae7c6950ebe8584f0b53ad88dc01a9605e.tar.bz2
BUG: Fix VS IDE project order
Our implementation of the feature to pull in dependent targets in VS solution files for subprojects caused the order of project files in the solution to be arbitrary (based on pointer value in the representation). Target ordering in solution files is important to prevent unnecessary changing of the files and because the VS IDE selects the first project listed as the default active target. This change restores lexicographic order by target name.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.h')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 09bd84e..89698e4 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -97,6 +97,11 @@ 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:
static cmVS7FlagTable const* GetExtraFlagTableVS7();
virtual void OutputSLNFile(cmLocalGenerator* root,
@@ -114,18 +119,24 @@ protected:
virtual void WriteSLNHeader(std::ostream& fout);
virtual void AddPlatformDefinitions(cmMakefile* mf);
+ class OrderedTargetDependSet: public std::set<cmTarget*, TargetCompare>
+ {
+ public:
+ OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
+ };
+
virtual void WriteTargetsToSolution(
std::ostream& fout,
cmLocalGenerator* root,
- cmGlobalGenerator::TargetDependSet& projectTargets,
+ OrderedTargetDependSet const& projectTargets,
cmGlobalGenerator::TargetDependSet& originalTargets);
virtual void WriteTargetDepends(
std::ostream& fout,
- cmGlobalGenerator::TargetDependSet& projectTargets);
+ OrderedTargetDependSet const& projectTargets);
virtual void WriteTargetConfigurations(
std::ostream& fout,
cmLocalGenerator* root,
- cmGlobalGenerator::TargetDependSet& projectTargets);
+ OrderedTargetDependSet const& projectTargets);
void AddAllBuildDepends(cmLocalGenerator* root,
cmTarget* target,