Use StaticQt5::* for static Qt5 imported targets

Fallback to old version (Qt5::static::*) if not found
This commit is contained in:
Martchus 2016-11-12 02:24:06 +01:00
parent c443250989
commit 70a9d68555
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@ if(NOT DEFINED QT_LINKAGE_DETERMINED)
# - has the advantage that usage of dynamic and static Qt during the same build is possible
find_package(StaticQt5${MODULE})
if(StaticQt5${MODULE}_FOUND)
set(QT5_${MODULE}_STATIC_LIB Qt5::static::${MODULE})
if(TARGET StaticQt5::${MODULE})
set(QT5_${MODULE}_STATIC_LIB StaticQt5::${MODULE})
else()
set(QT5_${MODULE}_STATIC_LIB Qt5::static::${MODULE})
endif()
set(QT5_${MODULE}_ASSUME_STATIC OFF)
set(QT5_${MODULE}_FOUND ON)
# reverse lookup for pkg-config