From 37ebeb910073aa142b41daa949dabf978e4d749d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 8 Jan 2014 10:25:07 +0100 Subject: FindQt4: Fix use of get_target_property to use actual target name. This was introduced in ba48e63f (Generate config-specific interface link libraries propeties., 2013-02-09). --- Modules/FindQt4.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/FindQt4.cmake') diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 28b84543d9..2c4e765538 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1187,7 +1187,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endmacro() macro(_qt4_add_target_private_depends _QT_MODULE) - get_target_property(_configs ${_QT_MODULE} IMPORTED_CONFIGURATIONS) + 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() -- cgit v1.2.1 From ab9f58f657a244d182ccd9a9361fae0a7c068f20 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 8 Jan 2014 10:26:49 +0100 Subject: FindQt4: Ensure target exists before calling get_target_property. This macro is called for all potential Qt targets, even those which were not found. --- Modules/FindQt4.cmake | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'Modules/FindQt4.cmake') diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 2c4e765538..03924fa20d 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -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() -- cgit v1.2.1