Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for client code usage #120

Open
offa opened this issue Apr 10, 2019 · 1 comment
Open

Documentation for client code usage #120

offa opened this issue Apr 10, 2019 · 1 comment

Comments

@offa
Copy link
Collaborator

offa commented Apr 10, 2019

There's no good documentation around, how this library is integrated in client projects (#119).

@iwanders
Copy link
Contributor

iwanders commented Oct 5, 2019

Was about to file a PR and I saw this issue and related #119. Just quickly chiming in, since this is really simple since my contributions in PR's #116, #108 and #110 .

In the most minimal form, a direct copy paste from the description of #116. This should work after an install (make install) of seasocks has been performed:

cmake_minimum_required(VERSION 3.3)
find_package(Seasocks 1.4.0) # Requires at least version 1.4.0.
add_executable(my_server serve.cpp)
target_link_libraries(my_server Seasocks::seasocks)

Seasocks can also be used as a submodule inside the directory structure of the host cmake project. In that case let's assume seasocks is located in the thirdparty folder.

Doing something like:

if(USE_EXTERNAL_SEASOCKS)
  find_package(Seasocks REQUIRED)
else()
  set(UNITTESTS OFF CACHE INTERNAL "")
  set(SEASOCKS_EXAMPLE_APP OFF CACHE INTERNAL "")
  add_subdirectory(thirdparty/seasocks)
endif()

After those lines you can just link your binary / library against the now exported Seasocks::seasocks target with the target_link_libraries(my_server Seasocks::seasocks) instruction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants