On Fri, Oct 1, 2010 at 4:16 PM, James Bigler <jamesbig...@gmail.com> wrote:

> I really like the new FOLDER property for targets.
>
> I'm wondering if it could be extended to allow me to set this for a whole
> directory.  Something like:
>
> set_property(DIRECTORY PROPERTY FOLDER "Utilities/3rdParty")
> add_executable(a ...)
> add_library(b ...)
> add_subdirectory(dir) # dir also get's this property
>
> This would make it pretty speedy to add this feature without having to add
> the set_property to each target, and it would be easier to maintain.  Any
> new projects would get the property as well.
>
> James
>

I'm looking at the CL that added it:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6ac0aacf6c3ce17141870e252fda77d994782d3

diff --git a/Source/cmGlobalVisualStudio7Generator.cxx
b/Source/cmGlobalVisualStudio7Generator.cxx


index 9631e9a..f455810 100644 (file)
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -300,6 +300,48 @@ void
cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
                             cmLocalGenerator::START_OUTPUT);
         this->WriteProject(fout, vcprojName, dir.c_str(),
                            *target);
+
+        // Create "solution folder" information from FOLDER target property
+        //
+        if (this->UseFolderProperty())
+          {
+          const char *targetFolder = target->GetProperty("FOLDER");
+          if (targetFolder)
+            {

It seems like some extra code could be added to also check the directory
properties if the target properties doesn't exit.  Is this hard to do?
Should I attempt it and submit a patch?

James
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to