set(QT_USE_QTNETWORK true)

option(USE_SYSTEM_VREEN "Force use system vreen instead build-in copy" OFF)

if(USE_SYSTEM_VREEN)
  find_package(PkgConfig)
    if(PKG_CONFIG_FOUND)
      pkg_check_modules(VREEN REQUIRED vreen)
      #another spike. In pkgconfig LIBRARIES macro list only lib names
      set(VREEN_LIBRARIES ${VREEN_LDFLAGS})
  endif()
endif()
if(NOT VREEN_FOUND)
  if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
    set(VREEN_IMPORTS_DIR bin)
  endif()
  set(VREEN_WITH_QMLAPI OFF CACHE INTERNAL "")
  set(VREEN_WITH_OAUTH ON CACHE INTERNAL "")
  set(VREEN_INSTALL_HEADERS OFF CACHE INTERNAL "")
  set(VREEN_DEVELOPER_BUILD OFF CACHE INTERNAL "")
  set(VREEN_WITH_EXAMPLES OFF CACHE INTERNAL "")
  set(VREEN_WITH_TESTS OFF CACHE INTERNAL "")
  add_subdirectory(vreen)
  message(STATUS "Using internal copy of vreen")
  set(VREEN_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/vreen/include CACHE INTERNAL "")
  set(VREEN_LIBRARIES vreen CACHE INTERNAL "")
endif()
