<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">you have to tell add_custom_command on what the output depends:</div></div>

<br>
add_custom_command (OUTPUT ${trofile}<br>
<div class="im"> Â COMMAND perl <a href="http://trans.pl" target="_blank">trans.pl</a> ${file} -o ${file_tro}<br>
</div> Â DEPENDS ${file}<br>
 Â )<br></blockquote><div><br></div><div>I&#39;m sorry. I should have been more clearer. I&#39;ve already done this. But what I&#39;m getting is the .tro files are generated even when the corresponding source file doesn&#39;t change.</div>
<div><br></div><div>I have some thing like this.</div><div><br></div><div><i>ForEach (file ${AllFiles})</i></div><div><i>List(APPEND trofiles ${TransOutFile})</i></div><div><i> Add_Custom_Command (</i></div><div><i>   Â  Â OUTPUT ${TransOutFile}</i></div>
<div><i>   Â  Â COMMAND ${PERL_EXECUTABLE} ${CUE_MAKE_DIR}/<a href="http://trcomp.pl">trcomp.pl</a> ${infileModified} -o ${TransOutFile} # this create .tro file from .cxx/.hxx file</i></div><div><i>   Â  Â WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}</i></div>
<div><i>   Â  Â DEPENDS ${file}</i></div><div><i>   Â  Â VERBATIM</i></div><div><i>   Â  Â )</i></div><div><i>End_Loop </i></div><div><i><br></i></div><div><div><i>  Add_Custom_Command (</i></div><div><i>   Â OUTPUT ${trxfile}</i></div>
<div><i>   Â COMMAND ${PERL_EXECUTABLE} ${CUE_MAKE_DIR}/<a href="http://trlink.pl">trlink.pl</a> -o ${trxfile} ${trofiles} // this combines all the .tro files to .trx file.</i></div><div><i>   Â WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}</i></div>
<div><i>   Â COMMENT &quot;Creating translation files for ${LibName} module&quot;</i></div><div><i>   Â DEPENDS ${trofiles}</i></div><div><i>   Â VERBATIM</i></div><div><i>   Â )</i></div><div><br></div><div><i>Add_Custom_Target (${TargetName}TrxFile DEPENDS ${trxfile})</i> # Create custom target to create .trx file from .tro files.</div>
<div><br></div></div><div><i>Add_Dependencies (${TargetName} ${TargetName}TrxFile)</i> # the library is now dependent on the previous custom target.</div><div><br></div><div><br></div><div>So when i build the library, these tro files gets generated and subsequently this .trx file. </div>
<div><br></div><div>I build it again (without modifying any source files)</div><div>The library itself does not get built, but this library depends upon trx file which in turn depend upon .tro files which in turn depends upon the source files. The source files are not changed and hence i expect the tro files does not get generated. But they are getting generated.</div>
<div><br></div><div>Am I missing something here ?</div><div><br></div><div>Thanks,</div><div>Surya</div></div>