CMake Build: Fix for building with Qt6

Qt5: :moc target is being used, and it had no alias.

Change-Id: I1350507b14089d70c64ed6632e6dcce8c4881f0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Cristian Adam
2020-04-28 22:29:29 +02:00
parent f80715a8ca
commit f6042b257d

View File

@@ -52,7 +52,7 @@ endforeach()
set(Qt5_FOUND ${Qt6_FOUND}) set(Qt5_FOUND ${Qt6_FOUND})
foreach(tool qmake lrelease) foreach(tool qmake lrelease moc)
if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool}) if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool})
add_executable(Qt5::${tool} IMPORTED GLOBAL) add_executable(Qt5::${tool} IMPORTED GLOBAL)
get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION_RELEASE) get_target_property(imported_location Qt6::${tool} IMPORTED_LOCATION_RELEASE)