summaryrefslogtreecommitdiffstats
path: root/cmake/QtModuleToolsVersionlessTargets.cmake.in
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/QtModuleToolsVersionlessTargets.cmake.in')
-rw-r--r--cmake/QtModuleToolsVersionlessTargets.cmake.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/QtModuleToolsVersionlessTargets.cmake.in b/cmake/QtModuleToolsVersionlessTargets.cmake.in
new file mode 100644
index 0000000000..6d0f57e039
--- /dev/null
+++ b/cmake/QtModuleToolsVersionlessTargets.cmake.in
@@ -0,0 +1,23 @@
+foreach(__qt_tool @tool_targets_non_prefixed@)
+ if(NOT TARGET Qt::${__qt_tool} AND TARGET Qt6::${__qt_tool})
+ add_executable(Qt::${__qt_tool} IMPORTED)
+
+ # Check all the usual imported location properties to find one that contains a path.
+ foreach(__qt_imported_location_config
+ IMPORTED_LOCATION
+ IMPORTED_LOCATION_RELEASE
+ IMPORTED_LOCATION_RELWITHDEBINFO
+ IMPORTED_LOCATION_MINSIZEREL
+ IMPORTED_LOCATION_DEBUG)
+
+ get_target_property(__qt_imported_location
+ Qt6::${__qt_tool} ${__qt_imported_location_config})
+ if(__qt_imported_location AND EXISTS "${__qt_imported_location}")
+ break()
+ endif()
+ endforeach()
+
+ set_target_properties(Qt::${__qt_tool}
+ PROPERTIES IMPORTED_LOCATION "${__qt_imported_location}")
+ endif()
+endforeach()