summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2023-10-10 15:12:22 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-10-11 06:32:26 +0000
commit058697d43865621378b9bfcc954fee5c34cd2be1 (patch)
tree371a3772ea6822d807e763caa81bfc70a08fcf71
parent81a8c9b4745b65c7636c8adce715a94be0289728 (diff)
CMake: Fix non-existing target error when cross-compiling
When cross-compiling, qt_get_tool_target_name() will actually name the target qhelpgenerator_native. Also, qt_internal_add_tool() might return early, so let's check the target is actually defined. This amends commit 85e769fc36, where the expicit dependency setting was added. Fixes: QTBUG-117974 Change-Id: Id0186e48a31c9410ec594ab0a2c98ec5a0f25fd0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 916277d66ddb7ee932553a80fb82c0dba2b8c0d7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 543843551ed78f0d3847e0aca8e1d6282404cce0)
-rw-r--r--src/assistant/qhelpgenerator/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/assistant/qhelpgenerator/CMakeLists.txt b/src/assistant/qhelpgenerator/CMakeLists.txt
index 7230d248e..436a82390 100644
--- a/src/assistant/qhelpgenerator/CMakeLists.txt
+++ b/src/assistant/qhelpgenerator/CMakeLists.txt
@@ -62,7 +62,7 @@ ${import_plugin_code}
)
endif()
else() # QT_BUILD_SHARED_LIBS
- if(QT_SUPERBUILD)
- add_dependencies(qhelpgenerator ${needed_plugins})
+ if(TARGET ${target_name} AND QT_SUPERBUILD)
+ add_dependencies(${target_name} ${needed_plugins})
endif()
endif()