if(ENABLE_QT4)
  find_package(Qt4 4.6.0 REQUIRED)
  # search packages used by KDE
  if(QTC_QT4_ENABLE_KDE)
    find_package(KDE4 REQUIRED)
    include(KDE4Defaults)
    set(QTCURVE_STYLE_DIR "${PLUGIN_INSTALL_DIR}/plugins/styles/")
    if(NOT Q_WS_X11 OR NOT QTC_X11_FOUND)
      # Kwin headers uses a lot of xcb types and functions and we cannot
      # provide declarations for all of them even if they are not used.
      if(QTC_QT4_ENABLE_KWIN)
        message(WARNING "KWin4 support require Q_WS_X11 and libxcb headers.")
      endif()
      set(QTC_QT4_ENABLE_KWIN Off)
    endif()
    if(NOT DEFINED QTC_QT4_ENABLE_KWIN)
      find_file(KWINGLOBALS_H kwinglobals.h ${KDE4_INCLUDES})
      if(KWINGLOBALS_H)
        set(QTC_QT4_ENABLE_KWIN On)
      else()
        set(QTC_QT4_ENABLE_KWIN Off)
      endif()
    endif()
  else()
    set(QTCURVE_STYLE_DIR "${QT_PLUGINS_DIR}/styles/")
  endif()
  add_definitions(${QT_DEFINITIONS} -DQTC_UTILS_QT4)
  include_directories(
    "${CMAKE_CURRENT_BINARY_DIR}"
    "${CMAKE_CURRENT_SOURCE_DIR}"
    "${QT_INCLUDE_DIR}")

  if(QTC_QT4_ENABLE_KDE)
    add_definitions(${KDE4_DEFINITIONS})
    include_directories(${KDE4_INCLUDES})
  endif()
endif()

add_subdirectory(colors)
add_subdirectory(common)
add_subdirectory(config)
add_subdirectory(themes)
add_subdirectory(kwin)
add_subdirectory(kwinconfig)
add_subdirectory(style)
