Use directory property instead of variable to determine target existance.
This is more resilient to calling find_package in a scope such as a function. Change-Id: I17e69a416f4aed3102fa6195d239bcf4ce0b306b Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
c18a41197f
commit
2b735ac8e6
@ -109,8 +109,9 @@ list(APPEND _Qt5Gui_LIB_DEPENDENCIES ${JPEG_LIBRARIES})
|
|||||||
|
|
||||||
!!ENDIF # Static
|
!!ENDIF # Static
|
||||||
|
|
||||||
if (NOT _Qt5$${CMAKE_MODULE_NAME}_target)
|
get_property(_qt5$${CMAKE_MODULE_NAME}TargetExists DIRECTORY PROPERTY _Qt5$${CMAKE_MODULE_NAME}_target)
|
||||||
set(_Qt5$${CMAKE_MODULE_NAME}_target 1)
|
if (NOT _qt5$${CMAKE_MODULE_NAME}TargetExists)
|
||||||
|
set_property(DIRECTORY PROPERTY _Qt5$${CMAKE_MODULE_NAME}_target TRUE)
|
||||||
!!IF !isEmpty(CMAKE_STATIC_TYPE)
|
!!IF !isEmpty(CMAKE_STATIC_TYPE)
|
||||||
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
|
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
|
||||||
!!ELSE
|
!!ELSE
|
||||||
|
Loading…
Reference in New Issue
Block a user