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

[REG 6.3.1 -> 6.3.2] qt_add_resources with .qm translation files no longer rebuild generated .qrc when .qm files change

    XMLWordPrintable

Details

    • c2aa05991d (qt/qtbase/dev) c2aa05991d (qt/tqtc-qtbase/dev) 9c027ac7ab (qt/qtbase/6.4) 87a8f36ff7 (qt/qtbase/6.4.1) 9c027ac7ab (qt/tqtc-qtbase/6.4) 87a8f36ff7 (qt/tqtc-qtbase/6.4.1) 87a8f36ff7 (qt/tqtc-qtbase/tqtc/qtinsight-6.4), 6453d17a0 (6.4)

    Description

      Hello,

      With following CMakeLists.txt:

      set(TS_FILES myapp_fr.ts)
      
      qt_add_executable(${PROJECT_NAME}
          [...]
      )
      
      qt_add_translations(${PROJECT_NAME}
          TS_FILES ${TS_FILES}
          SOURCES ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${PROJECT_QML_FILES}
          QM_FILES_OUTPUT_VARIABLE QM_FILES
      )
      
      qt_add_resources(${PROJECT_NAME} "translations"
          PREFIX "/i18n"
          BASE "${CMAKE_CURRENT_BINARY_DIR}"
          FILES "${QM_FILES}"
      )
      
      [...]
      

      Here is what happen with Qt 6.3.2:

      • When ts file changes, qm file is properly refreshed
      • However, qrc_translations.cpp is no longer rebuilt by "rcc"

      It was previously working properly with Qt 6.3.1.

      Issue seems to be related to a recent regression of Qt6LinguistToolsMacros.cmake, as commenting out the following code from qt6_add_lrelease fixes the issue:

              set_source_files_properties("${qm}" ${scope_args} PROPERTIES
                  _qt_resource_target_dependency "${target}_lrelease"
              )
      

      When the code above is present, qt_add_ressources will end up adding lrelease dependency but will no longer add the ${qm} file itself to dependencies, which leads to the issue.

      Best regards,
      Louis

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              amnell Louis du Verdier
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: