FindQt4: Ensure target exists before calling get_target_property.

This macro is called for all potential Qt targets, even those which were
not found.
This commit is contained in:
Stephen Kelly 2014-01-08 10:26:49 +01:00
parent 37ebeb9100
commit ab9f58f657
1 changed files with 15 additions and 11 deletions

View File

@ -1178,20 +1178,24 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endmacro()
macro(_qt4_add_target_depends _QT_MODULE)
get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS)
_qt4_add_target_depends_internal(${_QT_MODULE} INTERFACE_LINK_LIBRARIES ${ARGN})
foreach(_config ${_configs})
_qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} ${ARGN})
endforeach()
set(_configs)
if (TARGET Qt4::${_QT_MODULE})
get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS)
_qt4_add_target_depends_internal(${_QT_MODULE} INTERFACE_LINK_LIBRARIES ${ARGN})
foreach(_config ${_configs})
_qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} ${ARGN})
endforeach()
set(_configs)
endif()
endmacro()
macro(_qt4_add_target_private_depends _QT_MODULE)
get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS)
foreach(_config ${_configs})
_qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} ${ARGN})
endforeach()
set(_configs)
if (TARGET Qt4::${_QT_MODULE})
get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS)
foreach(_config ${_configs})
_qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} ${ARGN})
endforeach()
set(_configs)
endif()
endmacro()