Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Specifying name of output .qrc file when using qt_add_translations
Qt 6.11 is out! See what's new in the release blog

Specifying name of output .qrc file when using qt_add_translations

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 1 Posters 50 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Online
    PerdrixP Online
    Perdrix
    wrote last edited by
    #1

    Given the following in the CMake file for a static library:

    set(PROJECT_NAME DeepSkyStackerKernel)
      :
    qt_add_translations(${PROJECT_NAME}
        TS_FILE_DIR i18n
        PLURALS_TS_FILE i18n/${PROJECT_NAME}_en.ts
        PLURALS_TS_FILE i18n/${PROJECT_NAME}_en_GB.ts
        )
    

    Then, (AFAICT) a qrc file called DeepSkyStackerKernel_translations.qrc will be build dynamically and the .qm files added to that.

    I would very much prefer that the output qrc file were called simply "kernel_translations.qrc".

    How do I accomplish that?

    Thanks, David

    1 Reply Last reply
    0
    • PerdrixP Online
      PerdrixP Online
      Perdrix
      wrote last edited by
      #2

      The following appears to work, but is it the correct way to do it?

      qt_add_translations(${PROJECT_NAME}
          TS_FILE_DIR i18n
          PLURALS_TS_FILE i18n/${PROJECT_NAME}_en.ts
          PLURALS_TS_FILE i18n/${PROJECT_NAME}_en_GB.ts
          QM_FILES_OUTPUT_VARIABLE qm_files
          )
      qt_add_resources(${PROJECT_NAME} "kernel_translations"
          PREFIX "/i18n"
          BASE "${CMAKE_CURRENT_BINARY_DIR}"
          FILES ${qm_files}
          )
      
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved