Add install directory for plugins without type
When we run into a plugin that does not have a type and is not a qml plugin, we try to see if we can find the target installation path and provide INSTALL_DIRECTORY AND ARCHIVE_INSTALL_DIRECTORY to the add_qt_plugin call. We run into this frequently with the unit tests. 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. Change-Id: I61278904a4d2d72308079cd362bd085b4e2f540c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
fbf2759598
commit
b42feb02ce
@ -1783,9 +1783,9 @@ function(add_qt_plugin target)
|
||||
"${output_directory_default}" output_directory)
|
||||
qt_internal_check_directory_or_type(INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}" "${arg_TYPE}"
|
||||
"${install_directory_default}" install_directory)
|
||||
qt_internal_check_directory_or_type(ARCHIVE_INSTALL_DIRECTORY
|
||||
"${arg_ARCHIVE_INSTALL_DIRECTORY}" "${arg_TYPE}"
|
||||
"${archive_install_directory_default}" archive_install_directory)
|
||||
if (NOT arg_ARCHIVE_INSTALL_DIRECTORY AND arg_INSTALL_DIRECTORY)
|
||||
set(arg_ARCHIVE_INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}")
|
||||
endif()
|
||||
|
||||
if(arg_STATIC OR NOT BUILD_SHARED_LIBS)
|
||||
add_library("${target}" STATIC)
|
||||
|
@ -3106,6 +3106,11 @@ def write_plugin(cm_fh, scope, *, indent: int = 0) -> str:
|
||||
elif is_qml_plugin:
|
||||
plugin_function_name = "add_qml_module"
|
||||
qmldir = write_qml_plugin(cm_fh, plugin_name, scope, indent=indent, extra_lines=extra)
|
||||
else:
|
||||
target_path = scope.expandString('target.path')
|
||||
target_path = replace_path_constants(target_path, scope)
|
||||
if target_path:
|
||||
extra.append(f'INSTALL_DIRECTORY "{target_path}"')
|
||||
|
||||
plugin_class_name = scope.get_string("PLUGIN_CLASS_NAME")
|
||||
if plugin_class_name:
|
||||
|
Loading…
x
Reference in New Issue
Block a user