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/QtFindPackageHelpers.cmake | |
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/QtFindPackageHelpers.cmake')
-rw-r--r-- | cmake/QtFindPackageHelpers.cmake | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cmake/QtFindPackageHelpers.cmake b/cmake/QtFindPackageHelpers.cmake index 85dc1ff7db..5bfc0ff4f6 100644 --- a/cmake/QtFindPackageHelpers.cmake +++ b/cmake/QtFindPackageHelpers.cmake @@ -254,7 +254,7 @@ function(qt_record_extra_qt_main_tools_package_dependency main_target_name "${main_target_name}" "${qtfied_package_name_versioned}" "${dep_package_version}") endfunction() -# This function stores the list of Qt modules a library depend on, +# This function stores the list of Qt targets a library depend on, # along with their version info, for usage in ${target}Depends.cmake file function(qt_register_target_dependencies target public_libs private_libs) get_target_property(target_deps "${target}" _qt_target_deps) @@ -272,15 +272,13 @@ function(qt_register_target_dependencies target public_libs private_libs) foreach(lib IN LISTS lib_list) if ("${lib}" MATCHES "^Qt::(.*)") set(lib "${CMAKE_MATCH_1}") - if (lib STREQUAL Platform - OR lib STREQUAL GlobalConfig - OR lib STREQUAL GlobalConfigPrivate - OR lib STREQUAL PlatformModuleInternal - OR lib STREQUAL PlatformPluginInternal - OR lib STREQUAL PlatformToolInternal) + if (lib STREQUAL "Platform" + OR lib STREQUAL "GlobalConfig" + OR lib STREQUAL "GlobalConfigPrivate" + OR lib STREQUAL "PlatformModuleInternal" + OR lib STREQUAL "PlatformPluginInternal" + OR lib STREQUAL "PlatformToolInternal") list(APPEND target_deps "Qt6\;${PROJECT_VERSION}") - elseif ("${lib}" MATCHES "(.*)Private") - list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}") else() list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${lib}\;${PROJECT_VERSION}") endif() |