summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-10-27 18:07:01 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-11-04 15:21:15 +0100
commit237e5487597ec9ea0e1838cfb894e07d07f94e46 (patch)
treec3fbbfb4725b52749b9102bc6972ad67d1bff36b /examples
parentf8b7643b1686bc8c3b431822eedaf12e2d484b34 (diff)
downloadqttools-237e5487597ec9ea0e1838cfb894e07d07f94e46.tar.gz
CMake: Make lupdate/lrelease callable when building Qt
We'll use the CMake translation API in a subsequent commit. In preparation of that, we must ensure that lupdate/lrelease can be called when building Qt with examples. Prepare the commands with _qt_internal_wrap_tool_command(), which ensures that the Qt DLLs are in PATH when running on Windows by prepending the actual command with a batch file. With CMake >= 3.20 and Ninja Multi-Config, add_custom_target might not add the correct dependency to lupdate/lrelease if the $<TARGET_FILE> generator expression is not the first argument after COMMAND. We need $<TARGET_FILE> to be evaluated in the "command config", however it's evaluated in the "output config". According to the Ninja Multi-Config documentation of CMake, $<TARGET_FILE> should be evaluated in the "command config", since the OUTPUT here is always "a path that is common to more than one configuration". See upstream issue #22855. We force a "command config" dependency to lupdate (and lrelease) by adding an explicit "DEPENDS Qt6::lupdate". That CMake here chooses the "command config" dependency is what we deem as the correct behavior, which won't change after #22855 is fixed. Change-Id: I9dfbd5e903fc3b7306402a4eb7feef59e9c83ec2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions