set(QT_DONT_USE_QTCORE 0)
set(QT_DONT_USE_QTGUI 0)
find_package(Qt4 ${MITK_QT4_MINIMUM_VERSION} QUIET REQUIRED QtCore ${Qt4_REQUIRED_COMPONENTS_BY_MODULE})
include(${QT_USE_FILE})
list(APPEND ALL_LIBRARIES ${QT_LIBRARIES})

list(APPEND ALL_INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR})
#foreach(_module QtCore ${Qt4_REQUIRED_COMPONENTS_BY_MODULE})
#  string(TOUPPER ${_module} module)
#  list(APPEND ALL_INCLUDE_DIRECTORIES ${QT_${module}_INCLUDE_DIR})
#endforeach()

foreach(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
               QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
               QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
               QTDBUS QTXML QTSQL QTNETWORK QTCORE)
  if (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
    if (QT_${module}_FOUND)
      list(APPEND ALL_INCLUDE_DIRECTORIES ${QT_${module}_INCLUDE_DIR})
    endif ()
  endif ()
endforeach()
