Qt5LinguistTools cmake BYPRODUCTS declaration
-
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 missingBYPRODUCTS
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 inQt5LinguistToolsMacros.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
-
Hi,
Which version of CMake and Qt are you using ?
-
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.