summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-08-07 15:09:34 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-08-08 16:30:35 +0200
commit02a5b34c07a10e7fd5ffd785834e5da5a9cf9739 (patch)
treee2b1d18c003d6b083c6cbc1365d90ac207436c37
parent6fa2ce92af914d8fd6ab1fc32316b14bbae0bed0 (diff)
cmake: Defer generating plugin .pri file until finalizer
Allows adding additional properties to the target after the initial call to qt_internal_add_plugin. Change-Id: I7998c906e53699ec41b44b51aabbe480ae698b21 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtPluginHelpers.cmake20
1 files changed, 11 insertions, 9 deletions
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake
index 03d264b453..dfcdedb370 100644
--- a/cmake/QtPluginHelpers.cmake
+++ b/cmake/QtPluginHelpers.cmake
@@ -363,11 +363,6 @@ function(qt_internal_add_plugin target)
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL STATIC_LIBRARY)
- # There's no point in generating pri files for qml plugins. We didn't do it in Qt5 times.
- if(NOT plugin_type_escaped STREQUAL "qml_plugin")
- qt_generate_plugin_pri_file("${target}" pri_file)
- endif()
-
if(qt_module_target)
qt_internal_link_internal_platform_for_object_library("${plugin_init_target}")
endif()
@@ -417,9 +412,6 @@ function(qt_internal_add_plugin target)
DESTINATION "${config_install_dir}"
COMPONENT Devel
)
- if(pri_file)
- qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
- endif()
# Make the export name of plugins be consistent with modules, so that
# qt_add_resource adds its additional targets to the same export set in a static Qt build.
@@ -468,12 +460,22 @@ function(qt_finalize_plugin target)
_qt_internal_generate_win32_rc_file("${target}")
endif()
- # Generate .prl files for static plugins.
+ # Generate .prl and .pri files for static plugins.
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL STATIC_LIBRARY)
if(arg_INSTALL_PATH)
qt_generate_prl_file(${target} "${arg_INSTALL_PATH}")
endif()
+
+ # There's no point in generating pri files for qml plugins.
+ # We didn't do it in Qt5 times.
+ get_target_property(plugin_type "${target}" QT_PLUGIN_TYPE)
+ if(NOT plugin_type STREQUAL "qml_plugin")
+ qt_generate_plugin_pri_file("${target}" pri_file)
+ if(pri_file)
+ qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
+ endif()
+ endif()
endif()
endfunction()