diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-10 14:24:53 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-11 10:04:28 +0200 |
commit | a7162704c8f17a2c946e12a8137cb949bb9aaa5a (patch) | |
tree | 1b50b80f1dd21ade279e5ca2d6271f638839a937 | |
parent | 6d323c0b221a3b127d80e338a42306cc34bc4d40 (diff) |
CMake: Fix installation location of plugins in static builds of Qt
For static builds of Qt we installed the plugins into the lib
directory. However, they are expected in the plugins directory tree.
This happens, because we pass a value of an uninitialized variable to
ARCHIVE DESTINATION in the qt_install call in qt_internal_add_plugin,
and CMake defaults to "lib".
This flaw was introduced in b42feb02cee with the following intent:
"This patch also changes add_qt_plugin() to use the value provided in
INSTALL_DIRECTORY for ARCHIVE_INSTALL_DIRECTORY if no value is provided
for the latter."
The patch changed the value of arg_ARCHIVE_INSTALL_DIRECTORY but
missed to set the variable archive_install_directory, which is
actually used in the qt_install call.
We now directly set archive_install_directory and remove the unused
archive_install_directory_default variable.
Task-number: QTBUG-84781
Change-Id: Ifd0475d8452272e8765bf42fd912a45cfa3dbbd1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | cmake/QtBuild.cmake | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0a537ab4fa..e42c57c6f1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -3160,13 +3160,11 @@ function(qt_internal_add_plugin target) set(output_directory_default "${QT_BUILD_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") set(install_directory_default "${INSTALL_PLUGINSDIR}/${arg_TYPE}") - set(archive_install_directory_default "${INSTALL_LIBDIR}/${arg_TYPE}") if (arg_QML_TARGET_PATH) set(target_path "${arg_QML_TARGET_PATH}") set(output_directory_default "${QT_BUILD_DIR}/${INSTALL_QMLDIR}/${target_path}") set(install_directory_default "${INSTALL_QMLDIR}/${target_path}") - set(archive_install_directory_default "${INSTALL_QMLDIR}/${target_path}") endif() # Derive the class name from the target name if it's not explicitly specified. @@ -3185,8 +3183,9 @@ function(qt_internal_add_plugin target) if (NOT arg_SKIP_INSTALL) qt_internal_check_directory_or_type(INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}" "${arg_TYPE}" "${install_directory_default}" install_directory) - if (NOT arg_ARCHIVE_INSTALL_DIRECTORY AND arg_INSTALL_DIRECTORY) - set(arg_ARCHIVE_INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}") + set(archive_install_directory ${arg_ARCHIVE_INSTALL_DIRECTORY}) + if (NOT archive_install_directory AND install_directory) + set(archive_install_directory "${install_directory}") endif() endif() |