FindQt4: Don't fail if certain Qt modules are unavailable.

This commit is contained in:
Stephen Kelly 2013-05-23 17:02:05 +02:00 committed by Brad King
parent 5dd8c01429
commit b8af46cb87
1 changed files with 34 additions and 20 deletions

View File

@ -881,17 +881,21 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endforeach() endforeach()
if(Q_WS_WIN) if(Q_WS_WIN)
set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) if (QT_QAXCONTAINER_FOUND)
set(QT_MODULES ${QT_MODULES} QAxContainer)
# Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
PATHS ${QT_HEADERS_DIR}/ActiveQt PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
) )
endif()
if (QT_QAXSERVER_FOUND)
find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt
PATHS ${QT_HEADERS_DIR}/ActiveQt PATHS ${QT_HEADERS_DIR}/ActiveQt
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH
) )
endif() endif()
endif()
# Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
@ -1051,15 +1055,19 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
if(Q_WS_WIN) if(Q_WS_WIN)
_QT4_ADJUST_LIB_VARS(qtmain) _QT4_ADJUST_LIB_VARS(qtmain)
if(QT_QAXSERVER_FOUND)
_QT4_ADJUST_LIB_VARS(QAxServer) _QT4_ADJUST_LIB_VARS(QAxServer)
set_property(TARGET Qt4::QAxServer PROPERTY set_property(TARGET Qt4::QAxServer PROPERTY
INTERFACE_QT4_NO_LINK_QTMAIN ON INTERFACE_QT4_NO_LINK_QTMAIN ON
) )
set_property(TARGET Qt4::QAxServer APPEND PROPERTY set_property(TARGET Qt4::QAxServer APPEND PROPERTY
COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN) COMPATIBLE_INTERFACE_BOOL QT4_NO_LINK_QTMAIN)
endif()
if(QT_QAXCONTAINER_FOUND)
_QT4_ADJUST_LIB_VARS(QAxContainer) _QT4_ADJUST_LIB_VARS(QAxContainer)
endif() endif()
endif()
# Only public dependencies are listed here. # Only public dependencies are listed here.
# Eg, QtDBus links to QtXml, but users of QtDBus do not need to # Eg, QtDBus links to QtXml, but users of QtDBus do not need to
@ -1080,7 +1088,9 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
_qt4_add_target_depends(QtWebKit Gui Network) _qt4_add_target_depends(QtWebKit Gui Network)
_qt4_add_target_private_depends(Qt3Support Xml) _qt4_add_target_private_depends(Qt3Support Xml)
if(QT_VERSION VERSION_GREATER 4.6)
_qt4_add_target_private_depends(QtSvg Xml) _qt4_add_target_private_depends(QtSvg Xml)
endif()
_qt4_add_target_private_depends(QtDBus Xml) _qt4_add_target_private_depends(QtDBus Xml)
_qt4_add_target_private_depends(QtUiTools Xml Gui) _qt4_add_target_private_depends(QtUiTools Xml Gui)
_qt4_add_target_private_depends(QtHelp Sql Xml Network) _qt4_add_target_private_depends(QtHelp Sql Xml Network)
@ -1090,8 +1100,12 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
_qt4_add_target_private_depends(QtDeclarative XmlPatterns Svg Sql Gui) _qt4_add_target_private_depends(QtDeclarative XmlPatterns Svg Sql Gui)
_qt4_add_target_private_depends(QtMultimedia Gui) _qt4_add_target_private_depends(QtMultimedia Gui)
_qt4_add_target_private_depends(QtOpenGL Gui) _qt4_add_target_private_depends(QtOpenGL Gui)
if(QT_QAXSERVER_FOUND)
_qt4_add_target_private_depends(QAxServer Gui) _qt4_add_target_private_depends(QAxServer Gui)
endif()
if(QT_QAXCONTAINER_FOUND)
_qt4_add_target_private_depends(QAxContainer Gui) _qt4_add_target_private_depends(QAxContainer Gui)
endif()
_qt4_add_target_private_depends(phonon Gui) _qt4_add_target_private_depends(phonon Gui)
if(QT_QTDBUS_FOUND) if(QT_QTDBUS_FOUND)
_qt4_add_target_private_depends(phonon DBus) _qt4_add_target_private_depends(phonon DBus)