diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-04-06 18:57:11 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-05-20 19:40:45 +0200 |
commit | 425ff34aa10a02524f2d52f544dc00b539ef9a26 (patch) | |
tree | 9cc29e0bfb507c60ff0b7cc8209704e5bab04720 /cmake/QtPluginDependencies.cmake.in | |
parent | 640eb55c130c6c2c982dc212a8a5bd2b8fb7a225 (diff) |
Merge main and private targets of the internal modules
In cmake, targets are used as an entity for modules. This causes a
number of problems when we want to manipulate a module as a separate
entity with properties associated with it.
The _qt_internal_module_interface_name target property is introduced to
represent the module entity. All modules write a name to this property,
which will subsequently expand into the module name matched with
the module name in qmake.
The 'qt_internal_module_info' function is responsible for providing the
correct values for the module properties used when working with a module
target.
Unlike qmake, for internal modules in cmake it is expected that the
Private suffix will be specified explicitly. In case the user wants to
have a different module name, an additional argument
MODULE_INTERFACE_NAME of the qt_internal_add_module function is
introduced.
This also changes the way how target dependencies are collected and
resolved. Since the 'Private' suffix no longer means an unique
identifier of the module 'Private' part, we look for the both Private
and non-Private package names when resolving dependencies.
TODO: This change doesn't affect the existing internal modules, so to
keep compatibility with the existing code the existing internal modules
create 'Private' aliases. The code that provides backward compatibility
must be removed once all internal modules will get the proper names.
Taks-number: QTBUG-87775
Change-Id: Ib4f28341506fb2e73eee960a709e24c42bbcd5ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPluginDependencies.cmake.in')
-rw-r--r-- | cmake/QtPluginDependencies.cmake.in | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in index 7bd1eef9aa..f64cc77714 100644 --- a/cmake/QtPluginDependencies.cmake.in +++ b/cmake/QtPluginDependencies.cmake.in @@ -32,6 +32,9 @@ if(QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES) set(__qt_use_no_default_path_for_qt_packages "") endif() +# TODO: The dependencies lookup mechanism is common for Modules and Plugins. +# It should be moved to the common public helper file. +# # note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0" set(_target_deps "@target_deps@") foreach(_target_dep ${_target_deps}) @@ -39,7 +42,13 @@ foreach(_target_dep ${_target_deps}) list(GET _target_dep 1 version) if (NOT ${pkg}_FOUND) + set(pkg_names ${pkg}) + if(pkg MATCHES "(.*)Private$") + set(pkg_names "${CMAKE_MATCH_1};${pkg}") + endif() find_dependency(${pkg} ${version} + NAMES + ${pkg_names} PATHS @find_dependency_paths@ ${_qt_additional_packages_prefix_path} |