summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-27 15:03:08 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-27 14:21:58 +0000
commitfd590b94823bce357d426360c06555c4c07259b9 (patch)
tree06c23b4b6520d3784a67eb0479f4e7e688bd661e /cmake
parenta3ff42ade673a3f5f36d3b945df6a3bbc1eae92a (diff)
Don't create convenience plugin target when not needed
If the OUTPUT_NAME of a plugin is the same as the CMake target name, don't try to create a custom target with the same name. That will cause configuration errors due to duplicate targets. Amends f67d8ae2d4339c50cf0a4ca26f25c3afebc128ea Change-Id: Iaea7c68e22dbc1e345ba10950c312618abba4c21 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index b2f72d9807..d223ac0617 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2215,7 +2215,7 @@ function(qt_add_plugin target)
set_property(TARGET "${target}" PROPERTY OUTPUT_NAME "${output_name}")
# Add a custom target with the Qt5 qmake name for a more user friendly ninja experience.
- if(arg_OUTPUT_NAME)
+ if(arg_OUTPUT_NAME AND NOT TARGET "${output_name}")
add_custom_target("${output_name}")
add_dependencies("${output_name}" "${target}")
endif()