Skip to content

Andosius/DPP-CMake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

D++ CMake Cross Platform Utility

An easy to use D++ setup script

GitHub issues GitHub license

📖 About this project

The "DPP-CMake" project is an extension for your CMake build system that makes it easier to incorporate the Discord C++ library D++ into your project. Currently, the script is guaranteed to work on the following devices:

  • x64 Linux (Debian/Ubuntu)
  • x64 Windows
  • arm64 Linux (Debian/Ubuntu)
  • Raspberry Pi 4B (armhf native and aarch64/arm64 via auto build)
  • macOS (via Github Actions)

📘 Windows dependencies

To run the standard routine you need the following programs installed:

📗 Debian/Ubuntu dependencies

To run the standard routine you need the following packages. You can install them by running:
sudo apt-get -y install git make cmake gcc g++ libsodium-dev libopus-dev zlib1g-dev libssl-dev ninja-build pkg-config rpm

📕 RedHat/CentOS or every other Linux distro

You can try to find the Debian packages on your system and skip to the building process. DPP-CMake will try to build and implement it into your project.

📒 macOS dependencies

To run the standard routine you need the following packages. You can install them by running:
brew install git cmake make gcc libsodium libopusenc zlib openssl ninja pkg-config

It may be required to install xcode via command line: xcode-select --install.

📋 Usage

  1. Add the cmake directory to your directory structure
  2. Include the file (include(cmake/FetchDPP.cmake)). Don't change the path, it may include files by itself, it will break!
  3. Set the DPP release you want to use - example: set(DPP_VERSION "10.0.24")
  4. Create an executable add_executable("DPPBot" <source_files>) and call DPP_ConfigureTarget("DPPBot") on your target.
  5. Done! Easy as that! Depending on your OS and Architecture you are ready to go.

You can set these CMake options by adding something like -DVAR=VALUE. Rememeber to set it to OFF or ON.

Option Default value Description
DPP_NO_VCPKG ON Prevents D++ to build a VCPKG build
DPP_CORO OFF Enables coroutines on build 10.0.25+
DPP_FORCE_BUILD OFF Forces DPP-CMake to build it from sources

📐 Building

Go into your project directory, create a new directory called build and run cmake .. inside of it. This should auto-handle everything else for you.

✏️ Important notes

Check DPPs License before building your project! This project is not guaranteed to work and is not part of brainboxdotcc or officially supported by them.

📚 Known issues

Some builds may fail to install. DPP-CMake handles this by building libdpp by source. Depending of your systems power, this may take a while or not.
This issue is known on arm64 builds and will force DPP-CMake to build the project on its own. This is very slow (especially on a Raspberry Pi) but at the current time there is no other solution.

⚠️ Issues / Bugs

Please open a new Github issue for every problem you encounter that is not based on failure getting DPP-CMake to run. I am happy to help.

💬 D++ Community

Feel free to join the D++ Community! Join now!

About

An easy to use D++ setup script

Resources

License

Stars

Watchers

Forks