summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-07 19:19:36 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-07 19:19:36 (GMT)
commit0a097af097fbce43ecda6799db869585366604b7 (patch)
treea17e4f129e3ff8b824d205fdb5d8e51385f50d19 /Modules
parentc7550d5ef12d8185fad93d581ebd52474ae3d1b0 (diff)
parent57a67bf27efc286fffa883baad86c7d5d51834cc (diff)
downloadCMake-0a097af097fbce43ecda6799db869585366604b7.zip
CMake-0a097af097fbce43ecda6799db869585366604b7.tar.gz
CMake-0a097af097fbce43ecda6799db869585366604b7.tar.bz2
Merge topic 'qt4-target-depends'
57a67bf Qt4: Add module dependencies to the IMPORTED targets
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindQt4.cmake55
1 files changed, 55 insertions, 0 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index ea4d8f4..381141c 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -942,12 +942,36 @@ 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")
+ endif()
+ set_property(TARGET Qt4::${_QT_MODULE} APPEND PROPERTY
+ ${_PROPERTY}
+ "Qt4::Qt${_DEPEND}"
+ )
+ endforeach()
+ endif()
+ endmacro()
+
+ macro(_qt4_add_target_depends _QT_MODULE)
+ _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_INTERFACE_LIBRARIES ${ARGN})
+ endmacro()
+
+ macro(_qt4_add_target_private_depends _QT_MODULE)
+ _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES ${ARGN})
+ endmacro()
+
+
# Set QT_xyz_LIBRARY variable and add
# library include path to QT_INCLUDES
_QT4_ADJUST_LIB_VARS(QtCore)
foreach(QT_MODULE ${QT_MODULES})
_QT4_ADJUST_LIB_VARS(${QT_MODULE})
+ _qt4_add_target_depends(${QT_MODULE} Core)
endforeach()
_QT4_ADJUST_LIB_VARS(QtAssistant)
@@ -962,6 +986,37 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
_QT4_ADJUST_LIB_VARS(QAxContainer)
endif()
+ # Only public dependencies are listed here.
+ # Eg, QtDBus links to QtXml, but users of QtDBus do not need to
+ # link to QtXml because QtDBus only uses it internally, not in public
+ # headers.
+ # Everything depends on QtCore, but that is covered above already
+ _qt4_add_target_depends(Qt3Support Sql Gui Network)
+ _qt4_add_target_depends(QtDeclarative Script Gui)
+ _qt4_add_target_depends(QtDesigner Gui)
+ _qt4_add_target_depends(QtHelp Gui)
+ _qt4_add_target_depends(QtMultimedia Gui)
+ _qt4_add_target_depends(QtOpenGL Gui)
+ _qt4_add_target_depends(QtSvg Gui)
+ _qt4_add_target_depends(QtWebKit Gui Network)
+
+ _qt4_add_target_private_depends(Qt3Support Xml)
+ _qt4_add_target_private_depends(QtSvg Xml)
+ _qt4_add_target_private_depends(QtDBus Xml)
+ _qt4_add_target_private_depends(QtUiTools Xml Gui)
+ _qt4_add_target_private_depends(QtHelp Sql Xml Network)
+ _qt4_add_target_private_depends(QtXmlPatterns Network)
+ _qt4_add_target_private_depends(QtScriptTools Gui)
+ _qt4_add_target_private_depends(QtWebKit XmlPatterns)
+ _qt4_add_target_private_depends(QtDeclarative XmlPatterns Svg Sql Gui)
+ _qt4_add_target_private_depends(QtMultimedia Gui)
+ _qt4_add_target_private_depends(QtOpenGL Gui)
+ _qt4_add_target_private_depends(QAxServer Gui)
+ _qt4_add_target_private_depends(QAxContainer Gui)
+ _qt4_add_target_private_depends(phonon Gui)
+ if(QT_QTDBUS_FOUND)
+ _qt4_add_target_private_depends(phonon DBus)
+ endif()
#######################################
#