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

lrelease: OUTPUT_LOCATION is ignored for auto-generated *.ts files

XMLWordPrintable

    • b19b5116a (dev), 0c6abd7df (6.9), 4d3686a50 (6.8), edd8ad8a7 (dev), 6a4f41e7f (dev), f6d4e8e17 (6.9), efcf32f3c (6.9)

      Steps to reproduce
      1. Load the "hello tr()" example: https://doc.qt.io/qt-6/qtlinguist-hellotr-example.html
      2. Replace the section "#! [1]" of CMakeLists.txt with the following, and build the project

      #! [1]
      qt6_add_translations(hellotr
          # SOURCE_TARGETS hellotr
      )
      
      # From https://doc.qt.io/qt-6/qtlinguist-cmake-qt-add-translations.html#options
      set_source_files_properties(hellotr_en.ts hellotr_la.ts
          PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations")
      #! [1]
      

      3. Uncomment the line "SOURCE_TARGETS hellotr" and build the project

       

      Outcomes

      • (Step #2) The *.qm files get generated in ${CMAKE_CURRENT_BINARY_DIR}/translations (Expected)
      • (Step #3) The *.qm files get generated in ${CMAKE_CURRENT_BINARY_DIR} (Not Expected)

       

      Use-case
      We want to be able to write something like this:

      qt6_add_translations(hellotr
          SOURCE_TARGETS hellotr
          TS_FILES_OUTPUT_VARIABLE TS_FILES
      )
      set_source_files_properties(${TS_FILES}
          PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations"
      )
      

        For Gerrit Dashboard: QTBUG-132613
        # Subject Branch Project Status CR V

            jbornema Joerg Bornemann
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: