Hello all,<div>I'm struggling with add_custom_command. Let me explain the problem in detail.</div><div><br></div><div>I've these set of cxx files and hxx files. I run a perl script on each of them to generate a certain kind of translation file. The command looks like </div>
<div><br></div><div><i>perl <a href="http://trans.pl">trans.pl</a> source.cxx -o source_cxx_tro</i></div><div><i><br></i></div><div>and similarly for header.hxx files as well.</div><div><br></div><div>So I'll end up with some multiple commands (each for a file)</div>
<div><br></div><div>Then I run another perl scripn on the output generated from these commands (source_cxx_tro, header_hxx_tro)</div><div><br></div><div><i>perl <a href="http://combine.pl">combine.pl</a> source_cxx_tro header_hxx_tro -o dir.trx</i></div>
<div><i><br></i></div><div><i>dir.trx</i> is the output file. </div><div><br></div><div>I've something like this.</div><div><br></div><div><i>Loop_Over_All_Files()</i></div><div><i>Add_Custom_Command (OUTPUT ${trofile} COMMAND perl <a href="http://trans.pl">trans.pl</a> ${file} -o ${file_tro})</i></div>
<div><i>List (APPEND trofiles ${file_tro})</i></div><div><i>End_Loop()</i></div><div><br></div><div><i>Add_Custom_Command (TARGET LibraryTarget POST_BUILD COMMAND perl <a href="http://combine.pl">combine.pl</a> ${trofiles} -o LibraryTarget.trx)</i></div>
<div><br></div><div>What I expect is when building the post build target, the trofiles will be built first. but it is not the case. The ${trofiles} are not getting built and hence the post build command ends in a failure.</div>
<div>Is there any way I can tell the POST_BUILD command depend on the previous custom command ?</div><div><br></div><div>Any suggestions ?</div><div><br></div><div>Thanks in advance,</div><div>Surya</div>