<div>For VS8-VS9, this won&#39;t be a big issue since Visual Studio does not use the .user file directly, instead it copies it and creates a DOMAIN.USER.user file instead. For VS10, however, it does not do this, so when we edit the .user file it will use that file directly. I think VS10 is the only version that will be of concern to your point.</div>
<div><br></div><div>I think instead of adding this to the target properties function, we should add a new function for this, for several reasons:</div><div><br></div><div>1) There are a ton of properties one can set in the USER file. These would only add to the already-cluttered target properties list.</div>
<div>2) Since these are all VS specific, adding a new command will be easier to track the MS IDE specific properties.</div><div>3) If we add them to set_target_properties, we&#39;ll need to use some strange naming convention to make it obvious that these are not portable. For example: VS_DEBUG_USER_COMMAND_PARAMETERS. Whereas if we have a &quot;set_user_properties&quot; command, we can give them cleaner names like COMMAND_PARAMETERS, ENVIRONMENT_VARIABLES, WORKING_DIRECTORY, and so forth.</div>
<div><br></div><div>Example:</div><div><br></div><div>set_user_properties( target_name PROPERTIES COMMAND_PARAMETERS &quot;-debug -reg&quot; ENVIRONMENT_VARIABLES=&quot;${path};INSTALL_DIR=${installdir}&quot; )</div><div>
<br></div><div>When generating for anything that isn&#39;t the VS IDE, or doesn&#39;t have a similar, translatable concept, this function will be a no-op.<br clear="all"><div><br></div><div>---------</div>Robert Dailey<br>

<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 9:41 AM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;m sure there are a handful of interested parties on this topic.<br>
<br>
One concern I would have is that if we start to generate this, we<br>
might clobber stuff that users go in and edit by hand in the Visual<br>
Studio UI. It&#39;s a minor concern, but if I do go in and add a<br>
&quot;PATH=1;2;3;4&quot; to the environment, then I wouldn&#39;t want CMake to<br>
clobber it. I could get used to editing a CMake file or a<br>
configuration .in file for such settings though...<br>
<br>
It&#39;s a reasonable idea.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jan 11, 2012 at 9:54 AM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt; I guess I have failed to strike the interest of anyone on this?<br>
&gt;<br>
&gt; ---------<br>
&gt; Robert Dailey<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jan 9, 2012 at 5:58 PM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; there are .user files generated by newer versions of Visual Studio (since<br>
&gt;&gt; 2005 I believe) that contain per-machine or per-workspace information. For<br>
&gt;&gt; all intents and purposes these are temporary files that are not checked into<br>
&gt;&gt; version control.<br>
&gt;&gt;<br>
&gt;&gt; The normal file naming convention for these are:<br>
&gt;&gt;<br>
&gt;&gt; project.vcproj.DOMAIN.USER.user<br>
&gt;&gt;<br>
&gt;&gt; Where DOMAIN is the machine/domain name, and USER is the local account<br>
&gt;&gt; name.<br>
&gt;&gt;<br>
&gt;&gt; I found out a couple of years ago that if you rename it to this:<br>
&gt;&gt;<br>
&gt;&gt; project.vcproj.user<br>
&gt;&gt;<br>
&gt;&gt; Visual Studio will treat this as &quot;defaults&quot; for the machine-specific<br>
&gt;&gt; version created using the naming convention I first outlined.<br>
&gt;&gt;<br>
&gt;&gt; The user files are useful for setting debug working directory and command<br>
&gt;&gt; arguments. There are some other things you can set but I have never found a<br>
&gt;&gt; use for them. Since I like to set these two parameters, what I&#39;ve done is<br>
&gt;&gt; keep my template user file in version control, and use CMake&#39;s<br>
&gt;&gt; configure_file() to fill in the command arguments and working directory<br>
&gt;&gt; fields for me. This approach is a good workaround but I&#39;d really like to see<br>
&gt;&gt; CMake generate these for me. Right now I have to keep 1 user file for each<br>
&gt;&gt; version of visual studio that can be used, and configure them differently<br>
&gt;&gt; based on VS IDE selection.<br>
&gt;&gt;<br>
&gt;&gt; Would it be suitable for CMake to incorporate this functionality? If CMake<br>
&gt;&gt; provided built-in support for this, we could create target properties that<br>
&gt;&gt; would set these fields on the target (it would set them on the generated<br>
&gt;&gt; user file instead of the vcproj file like normal target properties would<br>
&gt;&gt; do):<br>
&gt;&gt;<br>
&gt;&gt; set_target_properties( project PROPERTIES<br>
&gt;&gt;    DEBUG_COMMAND_ARGUMENTS &quot;-debug -reg&quot;<br>
&gt;&gt;    DEBUG_WORKING_DIRECTORY &quot;${CMAKE_CURRENT_SOURCE_DIR}&quot;<br>
&gt;&gt; )<br>
&gt;&gt;<br>
&gt;&gt; I&#39;d be happy to help implement this should David, Bill, and others find it<br>
&gt;&gt; to be a good idea.<br>
&gt;&gt;<br>
&gt;&gt; PS: I think I can do it without boost this time ;)<br>
&gt;&gt;<br>
&gt;&gt; ---------<br>
&gt;&gt; Robert Dailey<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; --<br>
&gt;<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>