QTP0008

Forwards deploy script arguments without re-evaluating them.

This policy was introduced in Qt 6.12. The policy affects how the version-less qt_generate_deploy_script() and qt_generate_deploy_app_script() commands pass their arguments to the implementation code.

Both commands used to be macros. A macro substitutes its arguments textually and the result is parsed again, so escape sequences and ${} references in the argument values were evaluated a second time. Projects had to escape such values twice to compensate.

If the policy is set to OLD, the values are forwarded through a macro, so they are re-evaluated the way they used to be.

If the policy is set to NEW, the values are forwarded through a function, so they remain unchanged.

When the policy is not set, the values are re-evaluated as with OLD, and an AUTHOR_WARNING is emitted, but only if the re-evaluation actually changes one of the values. The warning shows the values before and after, so that it is clear what has to be adapted.

Consider the code snippet below:

 qt_generate_deploy_script(
     OUTPUT_SCRIPT deploy_script
     CONTENT "
 qt_deploy_qt_conf(\"\${QT_DEPLOY_PREFIX}/qt.conf\")
 "
 )

With the policy unset or OLD, the reference is expanded while the arguments are forwarded, and the generated script ends up with qt_deploy_qt_conf("/qt.conf"). With the policy set to NEW, the reference reaches the generated script and is expanded when that script runs.

A forwarded value that contains an invalid backslash escape will fail at command invocation while the policy is unset or OLD. An AUTHOR_WARNING is emitted referencing this policy before the error is reported by CMake.

Note: The OLD behavior of a policy is deprecated, and may be removed in the future.

See also qt_policy(), Qt CMake policies, qt_generate_deploy_script(), and qt_generate_deploy_app_script().