<br><br>
<div class="gmail_quote">2009/3/25 Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>On 25. Mar, 2009, at 9:33, ankit jain wrote:<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">2009/3/25 Michael Wild &lt;<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>&gt;<br>
</blockquote><br></div>[...] 
<div class="im"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>What I usually do is this:<br><br>add_custom_command( OUTPUT ${TARDIR}/t1<br>COMMAND ${CMAKE_COMMAND} -E tar xvf ${TARDIR}/mytar.tar<br>
WORKING_DIRECTORY ${TARDIR}<br>COMMENT &quot;Extracting ${TARDIR}/mytar.tar&quot;<br>VERBATIM<br>)<br><br>add_custom_target( extract_mytar<br>DEPENDS ${TARDIR}/t1<br>)<br><br>This tells CMake how to obtain the file ${TARDIR}/t1 by unpacking<br>
mytar.tar. Then it adds a target which depends on that file. You then can<br>have other targets depend on that by using add_dependencies.<br><br></blockquote><br><br>Thanks for your suggestions it works but the problem is that iam making a<br>
library which requires some source files which will come after extracting it<br>from tar.<br><br>In that making an custom target for it and then add_dependencies to that<br>library to this custom build target does not solve the purpose.<br>
<br>then how to include those files which is required by the library which came<br>from tar.<br></blockquote><br><br></div>if you add all the files from the tar archive to the OUTPUT list of add_custom_command, CMake should automatically set the GENERATED property of those file to TRUE. If you don&#39;t want to do that, you still can set that property manually, using e.g.:<br>
<br>set_source_files_properties( ${TARDIR}/t1 ${TARDIR}/t2 PROPERTIES GENERATED TRUE )<br><br>you then can use those files in a normal add_library or add_executable command. if you use the first approach (listing all files in the OUTPUT list), you don&#39;t even need the custom target, since CMake then will know how to &quot;create&quot; these files (by invoking the custom command).<br>
<font color="#888888"><br></font></blockquote>
<div> </div>
<div>Is there any way by which we just give the name of folder where files has extracted and add_library command will take it by some means it is becoz if we dont know what files will be genrated inside that folder or if there are large no.of files then listing them in OUTPUT is really cumbersome..</div>

<div> </div>
<div> </div>
<div>ankit</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><font color="#888888"><br>michael<br></font></blockquote></div><br>