[CMake] QT4_CREATE_TRANSLATION delete source ts files during clean

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Thu Feb 27 00:01:01 EST 2014


Hi Anatoly,

Within Slicer [1], we addressed the creation / updates of the translation
files by introducing a variable named Slicer_UPDATE_TRANSLATION  [2]

Then, within a macro named 'SlicerMacroTranslation.cmake' [3], depending on
the value of Slicer_UPDATE_TRANSLATION, we either call

   (1) QT4_CREATE_TRANSLATION

   or (2) QT4_ADD_TRANSLATION

The convenience macro is then called for each executables and libraries we
want to translate. See [4] and [5]

These pointers should help you moving forward.

The documentation of the Qt macros is available here [6]

Note also that the translations file are created/updated within the source
tree. That way, it is easy to commit them.

Hth
Jc

[1] http://wiki.slicer.org/slicerWiki/index.php/Documentation/Labs/I18N

[2]
https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMakeLists.txt#L247

[3]
https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroTranslation.cmake#L21-38

[4]
https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/Applications/SlicerApp/CMakeLists.txt#L77-98

[5]
https://github.com/Slicer/Slicer/blob/0dc6eab31c69f859db46a57d3c12ef6a2119f188/CMake/SlicerMacroBuildBaseQtLibrary.cmake#L175-193

[6] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#module:FindQt4


On Wed, Feb 26, 2014 at 11:24 PM, Anatoly Shirokov <shirokov_a at mail.ru>wrote:

>  Please see my comments below
>
> 27.02.2014 1:08, Stephen Kelly пишет:
>
> Anatoly Shirokov wrote:
>
> The translation file is usual source file, it is not binary artifact.
>
> I didn't say it was a binary artifact. It's a buildsystem artifact created
> by your buildsystem.
>
> This is source which can be updated by build system. But initially this is
> source file was made by myself for each supported languages and put it to
> repository.
>
> The only difference is that I have to support them in up to date state
> with the lupdate utility.
>
> Yes.
>
> I want to invoke lupdate automatically during
> build and after that commit updated translation files to use them by
> translator group.
>
> That seems fine.
>
> What's wrong with such approach?
>
> Maybe the details of your approach are too simple. If you commit the
> translation files resulting from your build to your repo, then how did you
> lose work?
>
> 1. get sources
> 2. update sources
> 3. build to update translation files
> 4. translate new items extracted during the last build (we can translate
> to several languages ourself)
> 5. make clean to build whole system (and I lose all translated items)
> 6. commit
> ...
> N. get sources
> N+1. ops, where are my translated items?
>
> Actually it was several times.
>
> BR,
> Anatoly Shirokov
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140227/3afec1e1/attachment-0001.html>


More information about the CMake mailing list