diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-04-21 13:28:57 +0200 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-04-22 09:51:12 +0200 |
commit | 6fbeef4c6b2323fc4b7856520c0f38f8139c9c54 (patch) | |
tree | 9457cdde24cfd8beeddbcf71d294a7af22457dc3 /cmake | |
parent | 26a0a8942135fed725ec3067ba05bae31bb4e645 (diff) |
CMake: Add qt6_add_plugin public API
This patch adds a publicly callable qt6_add_plugin() API to create
plugins. This API is meant to cover cases such as the plugandpaint
example.
This patch also renames qt_add_plugin to qt_internal_add_plugin in order
to avoid clashes with the public API. To avoid breaking the existing
projects, a compatibility wrapper function is enabled by default unless
QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified.
Fixes: QTBUG-82961
Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 6 | ||||
-rw-r--r-- | cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2ade160779..11f00e5222 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2634,7 +2634,7 @@ endfunction() function(qt_internal_check_directory_or_type name dir type default result_var) if ("x${dir}" STREQUAL x) if("x${type}" STREQUAL x) - message(FATAL_ERROR "qt_add_plugin called without setting either TYPE or ${name}.") + message(FATAL_ERROR "qt_internal_add_plugin called without setting either TYPE or ${name}.") endif() set(${result_var} "${default}" PARENT_SCOPE) else() @@ -2686,12 +2686,12 @@ set(__qt_add_plugin_multi_args # This is the main entry point for defining Qt plugins. # A CMake target is created with the given target. The TYPE parameter is needed to place the # plugin into the correct plugins/ sub-directory. -function(qt_add_plugin target) +function(qt_internal_add_plugin target) qt_internal_module_info(module "${target}") qt_internal_set_qt_known_plugins("${QT_KNOWN_PLUGINS}" "${target}") - qt_parse_all_arguments(arg "qt_add_plugin" + qt_parse_all_arguments(arg "qt_internal_add_plugin" "${__qt_add_plugin_optional_args};SKIP_INSTALL" "${__qt_add_plugin_single_args}" "${__qt_add_plugin_multi_args}" diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index d3a2a6012e..b700dc1843 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -282,6 +282,7 @@ macro(qt_examples_build_begin) # annotate where each example is installed to, to be able to derive a relative rpath, and it # seems there's no way to query such information from CMake itself. set(CMAKE_INSTALL_RPATH "${_default_install_rpath}") + set(QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY TRUE) endmacro() macro(qt_examples_build_end) |