function(cpprest_find_websocketpp)
  if(WEBSOCKETPP_FOUND)
    return()
  endif()

  find_package(WEBSOCKETPP CONFIG QUIET)
  if(WEBSOCKETPP_FOUND)
    message("-- Found websocketpp version " ${WEBSOCKETPP_VERSION} " on system")
    set(WEBSOCKETPP_INCLUDE_DIR ${WEBSOCKETPP_INCLUDE_DIR} CACHE INTERNAL "")
  else()
    message("-- websocketpp not found, using the embedded version")
    set(WEBSOCKETPP_FOUND 1 CACHE INTERNAL "" FORCE)
    set(WEBSOCKETPP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libs/websocketpp CACHE INTERNAL "")
  endif()
endfunction()