On Fri, Oct 1, 2010 at 4:16 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I really like the new FOLDER property for targets.<br><br>I'm wondering if it could be extended to allow me to set this for a whole directory. Something like:<br><br>set_property(DIRECTORY PROPERTY FOLDER "Utilities/3rdParty")<br>
add_executable(a ...)<br>add_library(b ...)<br>add_subdirectory(dir) # dir also get's this property<br><br>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.<br>
<font color="#888888">
<br>James<br>
</font></blockquote></div><br>I'm looking at the CL that added it:<br><a href="http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6ac0aacf6c3ce17141870e252fda77d994782d3">http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6ac0aacf6c3ce17141870e252fda77d994782d3</a><br>
<br>diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx<br><br><br>index 9631e9a..f455810 100644 (file)<br>--- a/Source/cmGlobalVisualStudio7Generator.cxx<br>+++ b/Source/cmGlobalVisualStudio7Generator.cxx<br>
@@ -300,6 +300,48 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(<br> cmLocalGenerator::START_OUTPUT);<br> this->WriteProject(fout, vcprojName, dir.c_str(),<br> *target);<br>
+<br>+ // Create "solution folder" information from FOLDER target property<br>+ //<br>+ if (this->UseFolderProperty())<br>+ {<br>+ const char *targetFolder = target->GetProperty("FOLDER");<br>
+ if (targetFolder)<br>+ {<br><br>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?<br>
<br>James<br>