Let CMAKE_INSTALL_PREFIX be "/usr/local", and consider a project with a
call to qt_generate_deploy_app_script.
Installing the project with DESTDIR set to "/tmp/bla" would install the
project targets to "/tmp/bla/usr/local" but the Qt libraries to
"/tmp/bla/tmp/bla/usr/local".
That happened, because we used QT_DEPLOY_PREFIX as DESTINATION in
file(INSTALL). QT_DEPLOY_PREFIX starts with $ENV{DESTDIR} and
file(INSTALL) also prepends DESTDIR.
The value of QT_DEPLOY_PREFIX is controlled by CMAKE_INSTALL_PREFIX. Use
the latter as DESTINATION in file(INSTALL) calls.
Pick-to: 6.5
Task-number: QTBUG-109553
Change-Id: I8f06d81968fa0de4f17c4f8bc9b17cc052da4c12
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>