Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.0.2, 5.3.1, 5.11.1, 5.12.4, 5.13.0
-
OS-independent
Description
As discussed in QTBUG-31860, which was suddenly closed by a no longer active user, using qt5_create_translation in a cmake-file will cause the following problem on clean or all actions including it (like rebuild):
The .ts-files are deleted and completly build new, loosing all translations that have made been so far.
This is not conform with http://qt-project.org/doc/qt-5/cmake-manual.html where the functionality is said to be: "The ts files are created and/or updated in the source tree"
This is a disadvantage compared to qmake.
A possible way to fix it was given by the original reporter, but it doesn't work any longer with Qt 5.3.1.
From my point of view the problem is the usage of add_custom_command(OUTPUT ...) instead of add_custom_command(TARGET ...) causing everything put into OUTPUT is deleted by cmake.
I've appended a modified version of Qt5LinguistToolsMacros.cmake containing a macro Qt5_UPDATE_TRANSLATION that contains a fix of that problem and an example of how to use it in Qt5UpdateTranslationTest.zip.
Attachments
Issue Links
- is duplicated by
-
QTBUG-96549 make clean removes ts file when using qt5_create_translation()
- Closed
- is replaced by
-
QTBUG-76410 CMake: Introduce qt_update_translation function
- Closed
- replaces
-
QTBUG-31860 CMake + Qt5LinguistToolsMacros.cmake: QT5_CREATE_TRANSLATION delete source ts files during clean
- Closed