[CMake] visual studio 2005 solution folders

wedekind wedekind at caesar.de
Thu Jun 21 08:26:52 EDT 2007


Hi David,

I've recently implemented a simple method to add a solution folder to Visual
Studio  projects. It basicly creates a solution-folder named "CMAKE" and
adds some CMake-generated projects to it. The source code sample below needs
to be added to cmGlobalVisualStudio71Generator::WriteSLNFile(), e.g. just
before the call to WriteSLNFooter(fout):

-- code --
// Add a solution-folder "CMAKE" and put all CMake-generated projects in it
fout << "Project(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"CMAKE\",
\"CMAKE\", {";
this->CreateGUID("CMAKE");
fout << this->GetGUID("CMAKE") << "}\n";
fout << "EndProject\n";
fout << "\tGlobalSection(NestedProjects) = preSolution\n";
fout << "\t\t{" << this->GetGUID("ALL_BUILD") << "} = {" <<
this->GetGUID("CMAKE") << "}\n";
fout << "\t\t{" << this->GetGUID("ZERO_CHECK")<< "} = {" <<
this->GetGUID("CMAKE") << "}\n";
fout << "\t\t{" << this->GetGUID("PACKAGE")   << "} = {" <<
this->GetGUID("CMAKE") << "}\n";
fout << "\t\t{" << this->GetGUID("INSTALL")   << "} = {" <<
this->GetGUID("CMAKE") << "}\n";
fout << "\tEndGlobalSection\n";

-- end-of-code --

This is of course no general solution but if you cannot wait, this should
get you started.

Cheers!

Marco

>Hi,
>
>Is there a way in CMake to create solution folders.  The VS 2005 IDE
>allows the nesting of projects inside of solution folders.  This is
>handy for solution files that contain perhaps dozens of projects.
>
>Is it possible to do this in CMake??
>
>There has been a bug filed for this @
>http://www.vtk.org/Bug/bug.php?op=vote&bugid=3796 back in 2006 but it
>still appears to be open...does anyone know if this feature will be
>implemented through CMake?
>
>Cheers,
>David




More information about the CMake mailing list