summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio71Generator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-09-03 17:53:22 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-09-03 17:53:22 (GMT)
commite6ac0aacf6c3ce17141870e252fda77d994782d3 (patch)
tree19890ba590b7c66cd20efe14c32841441e9d6a3e /Source/cmGlobalVisualStudio71Generator.cxx
parent11756b9608c7cf59a832296790b6938614cd6597 (diff)
downloadCMake-e6ac0aacf6c3ce17141870e252fda77d994782d3.zip
CMake-e6ac0aacf6c3ce17141870e252fda77d994782d3.tar.gz
CMake-e6ac0aacf6c3ce17141870e252fda77d994782d3.tar.bz2
Add FOLDER target property, for IDEs (#3796)
This work was started from a patch by Thomas Schiffer. Thanks, Thomas! See the newly added documentation of the FOLDER target property for details. Also added global properties, USE_FOLDERS and PREDEFINED_TARGETS_FOLDER. See new docs here, too. By default, the FOLDER target property is used to organize targets into folders in IDEs that have support for such organization. This commit adds "solution folder" support to the Visual Studio generators. Currently works with versions 7 through 10. Also, use the new FOLDER property in the ExternalProject test and in the CMake project itself.
Diffstat (limited to 'Source/cmGlobalVisualStudio71Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 1191575..897c3a2 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -111,6 +111,13 @@ void cmGlobalVisualStudio71Generator
OrderedTargetDependSet orderedProjectTargets(projectTargets);
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
+
+ bool useFolderProperty = this->UseFolderProperty();
+ if (useFolderProperty)
+ {
+ this->WriteFolders(fout);
+ }
+
// Write out the configurations information for the solution
fout << "Global\n";
// Write out the configurations for the solution
@@ -120,6 +127,15 @@ void cmGlobalVisualStudio71Generator
// Write out the configurations for all the targets in the project
this->WriteTargetConfigurations(fout, root, orderedProjectTargets);
fout << "\tEndGlobalSection\n";
+
+ if (useFolderProperty)
+ {
+ // Write out project folders
+ fout << "\tGlobalSection(NestedProjects) = preSolution\n";
+ this->WriteFoldersContent(fout);
+ fout << "\tEndGlobalSection\n";
+ }
+
// Write the footer for the SLN file
this->WriteSLNFooter(fout);
}