CMake: Avoid repeating DESTDIR when deploying Qt libs and plugins
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. Task-number: QTBUG-109553 Change-Id: I8f06d81968fa0de4f17c4f8bc9b17cc052da4c12 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 1f142d903835a86996a00c2ee32689c7fb10c1e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
43f6e10a7c
commit
6d75c0dea6
@ -239,7 +239,7 @@ function(_qt_internal_generic_deployqt)
|
||||
|
||||
# Deploy the Qt libraries.
|
||||
file(INSTALL ${resolved}
|
||||
DESTINATION "${QT_DEPLOY_PREFIX}/${arg_LIB_DIR}"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${arg_LIB_DIR}"
|
||||
FOLLOW_SYMLINK_CHAIN
|
||||
)
|
||||
|
||||
@ -255,7 +255,7 @@ function(_qt_internal_generic_deployqt)
|
||||
"${file_path}"
|
||||
)
|
||||
get_filename_component(destination "${destination}" DIRECTORY)
|
||||
string(PREPEND destination "${QT_DEPLOY_PREFIX}/${arg_PLUGINS_DIR}/")
|
||||
string(PREPEND destination "${CMAKE_INSTALL_PREFIX}/${arg_PLUGINS_DIR}/")
|
||||
file(INSTALL ${file_path} DESTINATION ${destination})
|
||||
|
||||
if(__QT_DEPLOY_MUST_ADJUST_PLUGINS_RPATH)
|
||||
|
Loading…
x
Reference in New Issue
Block a user