CMake: Fix idc in-tree example build when using CMake 3.24
When using CMake 3.24 to build qtactiveqt with in-tree examples, the
build would fail with
'C:/Users/qt/work/qt/qtactiveqt_build/bin/Debug/idc.exe'
is not recognized as an internal or external command,
This seems to happen due to a combination of things:
- using CMake 3.22+
- Windows -debug-and-release (Ninja Multi-Config)
- excluding the idc tool debug variant from being built with
EXCLUDE_FROM_ALL as part of a regular qt_internal_add_tool call
- using add_custom_command(POST_BUILD) instead of (OUTPUT)
- using $<TARGET_FILE> generator expression in the command
instead of just the target name (due to having to prepend
an environment setting shell script)
Fix this by wrapping the relevant $<TARGET_FILE> arguments in a
$<COMMAND_CONFIG> generator expression, similar how it was done in
97b1062674283afb0131e73d8319c95aa7087a8b for qtdeclarative.
Note that in one case, we split the $<IF> expression into
sub-expressions, and wrap $<TARGET_FILE> in $<COMMAND_CONFIG>
only for the tool path, because $<COMMAND_CONFIG> can only wrap the
outer-most generator expression in an argument, according to
the docs, and we don't want to apply it to the target and output
tlb file.
Pick-to: 6.4
Task-number: QTQAINFRA-5044
Change-Id: Ib5daa3b7c7d40761a42e5772add69c700752a6e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>