Details
-
Suggestion
-
Resolution: Invalid
-
P4: Low
-
None
-
5.15.2
-
None
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.