Home - smacklib/dev_smack_cpp GitHub Wiki

Compiler requirements

Consuming smack_cpp in your CMake project

Use CMake version 3.11 or better and add the following to your CMake project description:

include(FetchContent)

FetchContent_Declare(
  smack_cpp
  GIT_REPOSITORY https://github.com/smacklib/dev_smack_cpp.git
  GIT_TAG        v17.x
)

FetchContent_MakeAvailable(smack_cpp)

This dynamically downloads the version defined by GIT_TAGof smack_cpp from GitHub. The value for GIT_TAG is normally the latest release available from GitHub, the release page documents the necessary version tag.

After the call to FetchContent_MakeAvailable, the CMake targets defined by smack_cpp will be available to the rest of the build. This can be used in link dependencies like shown below:

target_link_libraries(yourTarget
    smack_cpp
)

Smack Functionality