summaryrefslogtreecommitdiffstats
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-26 21:03:04 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-02-26 21:03:04 (GMT)
commit4d5230d1d85a910f04cd2618decc5402023d00ff (patch)
tree9d953e75df32e501991c7760bce987341c7198d6 /Modules/FindQt4.cmake
parent793bf3fdacb3de5486e89b39824a25d29f0c8ff4 (diff)
downloadCMake-4d5230d1d85a910f04cd2618decc5402023d00ff.zip
CMake-4d5230d1d85a910f04cd2618decc5402023d00ff.tar.gz
CMake-4d5230d1d85a910f04cd2618decc5402023d00ff.tar.bz2
Only add existing targets to the Qt4 target depends properties.
Qt can be configured in ways which disable certain modules. Make sure we don't fail on that.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake16
1 files changed, 10 insertions, 6 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 078c031..f25e121 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -965,13 +965,17 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
macro(_qt4_add_target_depends_internal _QT_MODULE _PROPERTY)
if (TARGET Qt4::${_QT_MODULE})
foreach(_DEPEND ${ARGN})
- if (NOT TARGET Qt4::Qt${_DEPEND})
- message(FATAL_ERROR "_qt4_add_target_depends invoked with invalid arguments")
+ set(_VALID_DEPENDS)
+ if (TARGET Qt4::Qt${_DEPEND})
+ list(APPEND _VALID_DEPENDS Qt4::Qt${_DEPEND})
endif()
- set_property(TARGET Qt4::${_QT_MODULE} APPEND PROPERTY
- ${_PROPERTY}
- "Qt4::Qt${_DEPEND}"
- )
+ if (_VALID_DEPENDS)
+ set_property(TARGET Qt4::${_QT_MODULE} APPEND PROPERTY
+ ${_PROPERTY}
+ "${_VALID_DEPENDS}"
+ )
+ endif()
+ set(_VALID_DEPENDS)
endforeach()
endif()
endmacro()