<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/2 Saad Khattak <span dir="ltr">&lt;<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>If I have the following command:</div><div><br></div><div><div>  execute_process(</div><div>    COMMAND ${CMAKE_COMMAND} -E tar xzf mySDK.tar.gz</div><div>    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}</div>


<div>    )</div><div><br></div><div>the extraction works and extracts the tar in the current directory. But this:</div><div><br></div><div><div>  execute_process(</div><div>    COMMAND ${CMAKE_COMMAND} -E tar xzf mySDK.tar.gz</div>


<div>    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/someSubdirectory</div><div>    )</div><div><br></div><div>fails to extract into &#39;someDirectory&#39; (even if it already exists - although it &#39;should&#39; create the directory for me).</div>
</div></div></div></blockquote><div><br></div><div>No it shouldn&#39;t.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div><div>

<div>Am I misunderstanding some commands?</div></div></div></div></blockquote><br></div><div class="gmail_quote">Yes I think you misunderstand &quot;WORKING_DIRECTORY&quot; argument of &quot;execute_process&quot; command.<br>
</div><div class="gmail_quote">The WORKING_DIRECTORY MUST exists beforehand and it is NOT the job of &quot;execute_process&quot;<br></div><div class="gmail_quote">to create it. <br><br></div><div class="gmail_quote">A &quot;WORKING_DIRECTORY&quot; is **always** supposed to exists when used <br>
by the cmake command providing this option like:<br>add_custom_command, add_test or execute_process.<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">If you need to create a directory you can &quot;cmake -E make_directory&quot; <br>
</div><div class="gmail_quote">or &quot;file(MAKE_DIRECTORY ...)&quot;<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">That said &quot;cmake -E tar xzf mySDK.tar.gz&quot; will create any directory found in the archive as expected.<br>
</div><div class="gmail_quote">&quot;working directory&quot; for untar and &quot;[possibly] top-level directory&quot; created nby untar are not the same.<br></div><div class="gmail_quote"><br></div><br>-- <br>Erk<br>Le gouvernement représentatif n&#39;est pas la démocratie -- <a href="http://www.le-message.org" target="_blank">http://www.le-message.org</a>
</div></div>