summaryrefslogtreecommitdiff
path: root/cmake/QtPluginHelpers.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-03-11 11:19:48 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-03-11 11:29:25 +0000
commit82d50925f1a7d4ff852e5302fd9e8a3ae18763d0 (patch)
treeac59b9cb2ad3e681a52233e59c2347623c7c6a96 /cmake/QtPluginHelpers.cmake
parente6aff6c7ad155942a0f33612efd213aa458c1fe3 (diff)
downloadqtbase-82d50925f1a7d4ff852e5302fd9e8a3ae18763d0.tar.gz
Fix build of QTuioTouchPlugin with Makefile generator on macOS
For each plugin, we create a custom target with it's OUTPUT_NAME such that one simply can do 'ninja qtuiotouchplugin' to build it. QTuiTouchPlugin has qtuiotouchplugin as OUTPUT_NAME, which is problematic with Makefile generators on case-insensitive file systems. See CMake upstream issue #21915 for details. Work around this issue by not creating the custom target in this situation. Pick-to: 6.1 Fixes: QTBUG-84342 Change-Id: Id9a6cf0a01c179d5c93da4146e393cf00153ac4f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPluginHelpers.cmake')
-rw-r--r--cmake/QtPluginHelpers.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake
index 2df5f6e11d..b53a958344 100644
--- a/cmake/QtPluginHelpers.cmake
+++ b/cmake/QtPluginHelpers.cmake
@@ -82,8 +82,14 @@ function(qt_internal_add_plugin target)
# Add a custom target with the Qt5 qmake name for a more user friendly ninja experience.
if(arg_OUTPUT_NAME AND NOT TARGET "${output_name}")
- add_custom_target("${output_name}")
- add_dependencies("${output_name}" "${target}")
+ # But don't create such a target if it would just differ in case from "${target}"
+ # and we're not using Ninja. See https://gitlab.kitware.com/cmake/cmake/-/issues/21915
+ string(TOUPPER "${output_name}" uc_output_name)
+ string(TOUPPER "${target}" uc_target)
+ if(NOT uc_output_name STREQUAL uc_target OR CMAKE_GENERATOR MATCHES "^Ninja")
+ add_custom_target("${output_name}")
+ add_dependencies("${output_name}" "${target}")
+ endif()
endif()
if (ANDROID)