Skip to content

How should I keep uWebSocket in my repo? #1733

Answered by slavslavov
ademDurakovic asked this question in Q&A
Discussion options

You must be logged in to vote

Here is how I do it but you will need to tweak it for your needs:

FetchContent_Declare(
  uwsrepo
  GIT_REPOSITORY https://github.com/uNetworking/uWebSockets.git
  GIT_TAG v20.58.0
  GIT_SHALLOW true)

FetchContent_GetProperties(uwsrepo)
if(NOT uwsrepo_POPULATED)
  FetchContent_Populate(uwsrepo)

  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(UWS_LTO 0)
  else()
    set(UWS_LTO 1)
  endif()

  find_program(MAKE_EXECUTABLE NAMES gmake make mingw32-make nmake REQUIRED)
  execute_process(
    COMMAND ${CMAKE_COMMAND} -E env WITH_LTO=${UWS_LTO} LIBUS_NO_SSL=1 ${MAKE_EXECUTABLE}
    WORKING_DIRECTORY ${uwsrepo_SOURCE_DIR}/uSockets
    OUTPUT_STRIP_TRAILING_WHITESPACE)

  add_library(uwslib ST…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ademDurakovic
Comment options

@ademDurakovic
Comment options

Answer selected by ademDurakovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants