From fd590b94823bce357d426360c06555c4c07259b9 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 27 Jan 2020 15:03:08 +0100 Subject: [PATCH] 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 --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index b2f72d98070..d223ac06179 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()