diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-01-08 09:26:49 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-01-08 15:41:34 (GMT) |
commit | ab9f58f657a244d182ccd9a9361fae0a7c068f20 (patch) | |
tree | d529756d25fa9c2ee4be5d9c17933bf5876d1b4b /Modules/FindQt4.cmake | |
parent | 37ebeb910073aa142b41daa949dabf978e4d749d (diff) | |
download | CMake-ab9f58f657a244d182ccd9a9361fae0a7c068f20.zip CMake-ab9f58f657a244d182ccd9a9361fae0a7c068f20.tar.gz CMake-ab9f58f657a244d182ccd9a9361fae0a7c068f20.tar.bz2 |
FindQt4: Ensure target exists before calling get_target_property.
This macro is called for all potential Qt targets, even those which were
not found.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 2c4e765..03924fa 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() |