diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-04-09 12:56:23 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-04-15 09:27:23 +0200 |
commit | 9cd7d8306901946c3eeed3375940cee2949c1ba7 (patch) | |
tree | d0957e27eb23a1bb038f94667138c70cfa8e1b58 | |
parent | 33e098704e87354c58b3bf975c3113cb82f6be07 (diff) |
Check if all required Qt targets are declared when finalizing the module
CMake makes possible to specify a target in the target_link_library
call even if the target is not declared yet. This adds flexibility to
the target declaration arrangement. For the Qt modules we have to
restrict freedom, because of the .prl files generating. If the Qt
module depends on another Qt module, the dependecy must be declared
before the module finalizing step, otherwise this will cause invalid
records in the module .prl file.
TODO: The dependency order issue could be solved by using conditional
genex's when generating step1 .prl file. But we ask developers to
depend on Qt module targets that have been defined before their usage.
Fixes: QTBUG-89467
Change-Id: I12ce1000048fd4a2f3334f17720c8df1c680ca20
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | cmake/QtPrlHelpers.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake index 0aab301053..29555f1fb3 100644 --- a/cmake/QtPrlHelpers.cmake +++ b/cmake/QtPrlHelpers.cmake @@ -225,6 +225,9 @@ function(qt_internal_walk_libs set_property(TARGET ${lib_target_unaliased} PROPERTY IMPORTED_GLOBAL TRUE) endif() endif() + elseif("${lib_target}" MATCHES "^Qt::(.*)") + message(FATAL_ERROR "The ${CMAKE_MATCH_1} target is mentioned as a dependency for \ +${target}, but not declared.") else() set(final_lib_name_to_merge "${lib_target}") if(lib_target MATCHES "/([^/]+).framework$") |