summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio71Generator.cxx
diff options
context:
space:
mode:
authorTaylor Braun-Jones <taylor@braun-jones.org>2016-03-21 20:01:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-23 17:22:15 (GMT)
commitf069be054833f465ab469b534fddbc52c5c9913b (patch)
treecef4fffdbd67374055d67a7ce9c2f918c68f9fec /Source/cmGlobalVisualStudio71Generator.cxx
parentc05ea48545f04dee8666094b0731366b64dfc9ad (diff)
downloadCMake-f069be054833f465ab469b534fddbc52c5c9913b.zip
CMake-f069be054833f465ab469b534fddbc52c5c9913b.tar.gz
CMake-f069be054833f465ab469b534fddbc52c5c9913b.tar.bz2
VS: Fix default target support for targets nested inside a folder
It's not actually the first target in a `.sln` file that is treated as the default startup project, but rather the first fully defined target.
Diffstat (limited to 'Source/cmGlobalVisualStudio71Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index f6796a5..7b51fdf 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -97,14 +97,31 @@ void cmGlobalVisualStudio71Generator
OrderedTargetDependSet orderedProjectTargets(
projectTargets, this->GetStartupProjectName(root));
- this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
+ // Generate the targets specification to a string. We will put this in
+ // the actual .sln file later. As a side effect, this method also
+ // populates the set of folders.
+ std::ostringstream targetsSlnString;
+ this->WriteTargetsToSolution(targetsSlnString, root, orderedProjectTargets);
+
+ // VS 7 does not support folders specified first.
+ if (this->GetVersion() <= VS71)
+ {
+ fout << targetsSlnString.str();
+ }
+ // Generate folder specification.
bool useFolderProperty = this->UseFolderProperty();
if (useFolderProperty)
{
this->WriteFolders(fout);
}
+ // Now write the actual target specification content.
+ if (this->GetVersion() > VS71)
+ {
+ fout << targetsSlnString.str();
+ }
+
// Write out the configurations information for the solution
fout << "Global\n";
// Write out the configurations for the solution