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

Make it able to use LinguistTools under CMake Script Mode

    XMLWordPrintable

Details

    • All

    Description

      We can use qt5_create_translation() in regular CMakeLists.txt to update ts file and/or qm files, but if a single CMakeLists.txt did a lot of things, it can be hard to maintain and make the project file hard to understand. Splitting some logic into subproject can be a solution, since CMake has Script Mode (-P) can be used for non-build-system-related stuff, I try to split all update translation stuff to a standalone UpdateTranslation.cmake script.

      Sadly by invoking

      find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED LinguistTools)

      I found it's not able to do since Qt5LinguistToolsConfig.cmake is using add_executable() command which is not available under script mode.

      cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake:23 (add_executable):
      add_executable command is not scriptable

      Maybe allowing it to be used under script mode can be handy for this use case so we can use things like qt5_create_translation under CMake script mode.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            blumia Gary Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes