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. Qt5LinguistTools cmake BYPRODUCTS declaration
Forum Updated to NodeBB v4.3 + New Features

Qt5LinguistTools cmake BYPRODUCTS declaration

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
cmakeninjalinguist
5 Posts 2 Posters 1.7k Views 2 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.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote on last edited by
    #1

    Hi :-)

    I create translations for a Qt program built via CMake like this (excerpt of My CMakeLists.txt):

    set(trPlural_SOURCES
        ${CMAKE_CURRENT_SOURCE_DIR}/src/ExportPlayersDialog.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/src/ImportPlayersDialog.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/src/PlayersPage.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/src/ScorePage.cpp
    )
    
    set(TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/muckturnier_de.ts)
    qt5_create_translation(QM_FILES ${trPlural_SOURCES} ${TS_FILES}
                        OPTIONS -pluralonly -locations none)
    add_custom_target(Localization ALL DEPENDS ${QM_FILES})
    

    This works fine if the default generator (Unix Makefiles) is used. But when I generate for Ninja (cmake -G Ninja) it complains about a missing BYPRODUCTS declaration:

    CMake Warning (dev):
    
    Policy CMP0058 is not set: Ninja requires custom command byproducts to be
    explicit.  Run "cmake --help-policy CMP0058" for policy details.  Use the
    cmake_policy command to set the policy and suppress this warning.
    
    This project specifies custom command DEPENDS on files in the build tree
    that are not specified as the OUTPUT or BYPRODUCTS of any
    add_custom_command or add_custom_target:
    
    CMakeFiles/muckturnier_de_lst_file
    
    For compatibility with versions of CMake that did not have the BYPRODUCTS
    option, CMake is generating phony rules for such files to convince 'ninja'
    to build.
    
    Project authors should add the missing BYPRODUCTS or OUTPUT options to the
    custom commands that produce these files.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    

    I'm not really a build system pro, but apparently, the custom command is defined inside the qt5_create_translation macro (to be found in Qt5LinguistToolsMacros.cmake).

    So here's my question: Can this be fixed inside my CMakeLists.txt, or is this an upstream issue to be fixed inside the macros that Qt5LinguistTools ship?

    Cheers, Tobias

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of CMake and Qt are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • l3u_L Offline
        l3u_L Offline
        l3u_
        wrote on last edited by
        #3

        CMake 3.9.6. Happened both with Qt 5.9.6 and 5.11.1.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You should check the bug report system to see if there's already something related. If not, please consider opening a feature request providing a minimal compilable example that shows that behaviour.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • l3u_L Offline
            l3u_L Offline
            l3u_
            wrote on last edited by
            #5

            Thanks for the feedback, I opened Bug #71354.

            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