Hi Aaron, <br><br>Not sure if ti will help, but .... <br>Have you looked at using ExternalProject.cmake to checkout, configure and build project using CMake ? <br><br>Hth<br>Jc<br><br><div class="gmail_quote">On Wed, Jul 13, 2011 at 2:05 PM, 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Take the double quotes off the set commands for your args variables.<br>
And put spaces in between the dereferences of those vars in the<br>
execute_process command.<br>
<br>
Like this:<br>
<br>
# No double quotes here:<br>
if(NOT $ENV{CMAKE_SVN_USERNAME} STREQUAL &quot;&quot;)<br>
  set(_SvnCredPart --no-auth-cache)<br>
  set(_SvnUserPart --username $ENV{CMAKE_SVN_USERNAME})<br>
endif()<br>
if(NOT $ENV{CMAKE_SVN_PASSWORD} STREQUAL &quot;&quot;)<br>
  set(_SvnCredPart --no-auth-cache)<br>
  set(_SvnPassPart --password $ENV{CMAKE_SVN_PASSWORD})<br>
endif()<br>
<br>
# Spaces in between dereferenced vars here:<br>
execute_process(COMMAND &quot;${svnexe}&quot; --non-interactive<br>
  ${_SvnCredPart} ${_SvnUserPart} ${_SvnPassPart}<br>
  info .<br>
  OUTPUT_VARIABLE _out<br>
  ERROR_VARIABLE _err<br>
  RESULT_VARIABLE _res)<br>
<br>
message(STATUS &quot;out: ${_out}&quot;)<br>
message(STATUS &quot;err: ${_err}&quot;)<br>
message(STATUS &quot;res: ${_res}&quot;)<br>
<br>
<br>
HTH,<br>
David<br>
<div><div></div><div class="h5"><br>
<br>
On Wed, Jul 13, 2011 at 1:57 PM,  &lt;<a href="mailto:aaron.meadows@thomsonreuters.com">aaron.meadows@thomsonreuters.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I’ve been having a devil of a time with executing SVN with execute_process.<br>
&gt; Basically, I need to read environment variables to specify the username and<br>
&gt; password for builds on our build server (where we do not cache credentials).<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I’ve made several attempts at this, and have been foiled continually by one<br>
&gt; problem, exemplified in the attached CMakeLists.txt.  If I build arguments<br>
&gt; in variables and then specify them in the execute_process, I get an error<br>
&gt; like this:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; -- err: svn.exe: invalid option: --no-auth-cache --username foo --password<br>
&gt; bar<br>
&gt;<br>
&gt; Type &#39;svn help&#39; for usage.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; However, if I write the identical command to a file and execute that, I get<br>
&gt; no issue.  I’ve narrowed it down to the &lt;space&gt; between --username and foo,<br>
&gt; but can’t seem to figure out what the deal is.  I’ve tried replacing them<br>
&gt; with a value from string(ASCI 32 _sep), but that didn’t change the<br>
&gt; behavior.  I’ve tried this on Windows 7 and Windows Server 2008, and both<br>
&gt; behave the same way.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; You can try these two methods out on the CMakeLists.txt.  By default, it<br>
&gt; will use the straight execute_process.  If you call cmake with –D TestFile=1<br>
&gt; it will write the commands to a file and execute that.  (in which case<br>
&gt; you’ll get svn: &#39;.&#39; is not a working copy and not the invalid option issue)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks for any help you can provide!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Aaron Meadows<br>
&gt; Software Engineer<br>
&gt;<br>
&gt; Thomson Reuters<br>
&gt;<br>
&gt; Phone: <a href="tel:314.468.3530" value="+13144683530">314.468.3530</a><br>
&gt; Mobile: <a href="tel:636.541.6139" value="+16365416139">636.541.6139</a><br>
&gt; <a href="mailto:aaron.meadows@thomsonreuters.com">aaron.meadows@thomsonreuters.com</a><br>
&gt; <a href="http://thomsonreuters.com" target="_blank">thomsonreuters.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; This email was sent to you by Thomson Reuters, the global news and<br>
&gt; information company. Any views expressed in this message are those of the<br>
&gt; individual sender, except where the sender specifically states them to be<br>
&gt; the views of Thomson Reuters.<br>
</div></div>&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>
&gt;<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br><br>