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

qt_add_translations has no way of returning the automatically determined .ts file paths

    XMLWordPrintable

Details

    • All
    • 80480b06e (dev), d27b63e48 (6.8)

    Description

      Consider a project like this

      cmake_minimum_required(VERSION 3.24)
      
      project(untitled2 VERSION 0.1 LANGUAGES CXX)
      
      set(CMAKE_CXX_STANDARD 17)
      set(CMAKE_CXX_STANDARD_REQUIRED ON)
      
      find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools)
      qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES de)
      
      set(PROJECT_SOURCES
              main.cpp
              mainwindow.cpp
              mainwindow.h
              mainwindow.ui
      )
      
      
      qt_add_executable(untitled2
             ${PROJECT_SOURCES}
      )
      
      target_link_libraries(untitled2 PRIVATE Qt6::Widgets)
      
      qt_add_translations(untitled2)
      

      There's no good way to get the list of .ts files that were automatically created by qt_add_translations. I'd like to be able to do something like this:

      qt_add_translations(untitled2 TS_FILES_OUTPUT_VARIABLE ts_files)
      target_sources(untitled2 PRIVATE ${ts_files})
      set_source_files_properties(${ts_files} PROPERTIES HEADER_FILE_ONLY ON)
      source_group(Translations REGULAR_EXPRESSION "\\.ts$")
      

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes