Skip to main content

Standard Configuration

What You Need

  • CMake
    • Can be installed using Visual Studio installer, Cmake's website, or your package manager
  • OpenSSL library
    • For Windows users, you can install it using VCPKG and the command .\vcpkg\vcpkg install openssl:x64-windows or .\vcpkg\vcpkg install openssl:x86-windows.
    • For Linux users, use your package manager and install libssl-dev or openssl-devel. The name depends on your package manager.
  • A C++ Compiler
  • libCurl (Required for Linux)
    • install a package like libcurl4-openssl-dev on your package manager
    • on Windows, the cmake script should compile libCurl for you. So libCurl should be set up for you when you run cmake.
  • Windows SDK (Required for Windows)
    • If you are using Visual Studio, it's recommend you download this from the Visual Studio installer.
    • The library doesn't really use it but you can run into issues without it.


Creating a CMakeList file

├── deps
│ └── sleepy-discord
├── source.cpp
└── CMakeLists.txt
  1. In case you haven't already created a CMakeLists.txt file for your project. please do so on the root directory or folder of your project.

Writing a CMakeList file

cmake_minimum_required (VERSION 3.6)

add_executable(replace-me source.cpp)
  1. Replace replace-me with the name of your project or executable.

Linking Sleepy Discord

#Add these two lines
target_link_libraries(replace-me sleepy-discord)
  1. Add these two lines to the CMakeList.txt so that Sleepy Discord will be linked.

  2. If you are following the examples, you can skip this step. Otherwise, replace deps/sleepy-discord with the relative path to the sleepy-discord directory folder relative to the CmakeLists.txt file. Windows users, remember to use /.


In add_subdirectory, using a directory that isn't a subdirectory to the current folder will require you to add a path to the binary folder for sleepy-discord as the 2nd parameter. It is recommended that you don't do this.


Simple Example

├── deps
│ └── sleepy-discord
├── source.cpp
└── CMakeLists.txt
cmake_minimum_required (VERSION 3.6)

add_executable(replace-me source.cpp)

target_link_libraries(replace-me sleepy-discord)

Another Example

├── sleepy-discord
├── ui
│ └── switch.cpp
├── material
│ ├── matal.cpp
│ ├── plastic.cpp
│ └── glass.cpp
├── CMakeLists.txt
├── light.cpp
├── blob.cpp
└── main.cpp
cmake_minimum_required (VERSION 3.6)

add_executable(light-blob light.cpp blob.cpp
main.cpp ui/switch.cpp
material/metal.cpp material/plastic.cpp material/glass.cpp)

target_link_libraries(light-blob sleepy-discord)

Next Step

Choose your CMake Interface.

Recommendation for Windows Users

Any OS