<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/2 Saad Khattak <span dir="ltr"><<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@gmail.com</a>></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 'someDirectory' (even if it already exists - although it 'should' create the directory for me).</div>
</div></div></div></blockquote><div><br></div><div>No it shouldn'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 "WORKING_DIRECTORY" argument of "execute_process" command.<br>
</div><div class="gmail_quote">The WORKING_DIRECTORY MUST exists beforehand and it is NOT the job of "execute_process"<br></div><div class="gmail_quote">to create it. <br><br></div><div class="gmail_quote">A "WORKING_DIRECTORY" 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 "cmake -E make_directory" <br>
</div><div class="gmail_quote">or "file(MAKE_DIRECTORY ...)"<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">That said "cmake -E tar xzf mySDK.tar.gz" will create any directory found in the archive as expected.<br>
</div><div class="gmail_quote">"working directory" for untar and "[possibly] top-level directory" created nby untar are not the same.<br></div><div class="gmail_quote"><br></div><br>-- <br>Erk<br>Le gouvernement représentatif n'est pas la démocratie -- <a href="http://www.le-message.org" target="_blank">http://www.le-message.org</a>
</div></div>