Hello,<br><br>I saw Patrick&#39;s message at cmake mailing list (<a href="http://public.kitware.com/pipermail/cmake/2006-July/010055.html">http://public.kitware.com/pipermail/cmake/2006-July/010055.html</a>) searching for somethings that take cares of qt3 .ts translations files. His code didn&#39;t work, but it because of a single line: MAIN_DEPENDENCY translations/${prefix}-${lang}.ts ! I modified it a bit and transcribed it here:
<br><br>MACRO (QT4_WRAP_TS lupdate_outputs lrelease_outputs prefix)<br>&nbsp;&nbsp; &nbsp;set(QT_LUPDATE_EXECUTABLE lupdate)<br>&nbsp;&nbsp; &nbsp;set(QT_LRELEASE_EXECUTABLE lrelease)<br>&nbsp;&nbsp; &nbsp;FOREACH (lang ${ARGN})<br>#&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;create/update .ts file<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SET(tsfile translations/${prefix}-${lang}.ts)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ADD_CUSTOM_COMMAND(OUTPUT ${tsfile}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;COMMAND ${QT_LUPDATE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR} -ts ${tsfile}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>#&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;create .qm file
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SET(qmfile translations/${prefix}-${lang}.qm)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ADD_CUSTOM_COMMAND(OUTPUT ${qmfile}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;COMMAND ${QT_LRELEASE_EXECUTABLE} ${tsfile} -qm ${qmfile}<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;MAIN_DEPENDENCY translations/${prefix}-${lang}.ts
<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;)<br><br>#&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;append to the list of translations<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SET(${lupdate_outputs} ${${lupdate_outputs}} ${tsfile})<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SET(${lrelease_outputs} ${${lrelease_outputs}} ${qmfile})<br>&nbsp;&nbsp; &nbsp;ENDFOREACH(lang)
<br>ENDMACRO (QT4_WRAP_TS)<br><br>After this you run it, as the example below:<br><br>qt4_wrap_ts(foo_TS foo_QM foo<br>&nbsp;&nbsp;&nbsp; pt_BR<br>)<br><br>Then you add a target/executable that depends on foo_QM and it will generate the wanted .qm files.
<br>I&#39;m posting this here because I think FindQt4.cmake should already had this macro. As you can see, it could be easily adapted for it. Hope this get merged<br><br><br>Best Regards,<br>BrĂ¡ulio<br>