Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41736

CMake + Qt5LinguistToolsMacros.cmake: QT5_CREATE_TRANSLATION clean deletes .ts files instead of updating

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kkohne Kai Köhne
              raspe88 Ralf Spengler
              Votes:
              12 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes