diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-07-14 18:08:07 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-07-17 09:43:00 +0200 |
commit | 054b66a65748c9ebfafeca88bf31669a24994237 (patch) | |
tree | b3522bc08188abbc5d17028508b4b707d61a5a5a /cmake/QtPostProcess.cmake | |
parent | bc29555e6e2335e4079a9fd2f1a7e2991da87e46 (diff) |
CMake: Provide old style CMake variables for target info
This change provides the following per-module variables
Qt6Widgets_LIBRARIES, Qt6Widgets_INCLUDE_DIRS, Qt6Widgets_DEFINITIONS,
Qt6Widgets_COMPILE_DEFINITIONS, Qt6Widgets_PRIVATE_INCLUDE_DIRS.
These are deprecated and are only intended for easier porting from
Qt5 to Qt6. Qt consumers should instead rely on the Qt module targets
e.g target_link_libraries(app PRIVATE Qt6::Widgets)
Note that the variable contents includes transitive values for
everything except the _LIBRARIES variant. So Qt6Widgets_INCLUDE_DIRS
will contain values for Widgets, Gui and Core.
Qt6Widgets_LIBRARIES only contains a value like Qt6::Widgets, and when
that is used in target_link_libraries(), CMake will take care of the
transitivity.
Change-Id: I625e25aab7ba5eaf14de1dc76ba2a1a0c85e6226
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPostProcess.cmake')
-rw-r--r-- | cmake/QtPostProcess.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 49bb5c268d..f31e429233 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -77,6 +77,7 @@ function(qt_internal_create_module_depends_file target) # ModuleDependencies.cmake. get_target_property(target_deps "${target}" _qt_target_deps) set(target_deps_seen "") + set(qt_module_dependencies "") if(NOT arg_HEADER_MODULE) get_target_property(extra_depends "${target}" QT_EXTRA_PACKAGE_DEPENDENCIES) @@ -164,6 +165,10 @@ function(qt_internal_create_module_depends_file target) endif() list(APPEND target_deps_seen "${dep_name}\;${dep_ver}") + + if (dep_name MATCHES "${INSTALL_CMAKE_NAMESPACE}(.*)") + list(APPEND qt_module_dependencies "${CMAKE_MATCH_1}") + endif() endif() endif() endforeach() |