![]() |
D++ (DPP)
C++ Discord API Bot Library
|
To add D++ to a CLion project, you need obtain the library through VCPKG and then configure your CLion project and CMakeLists.txt
.
vcpkg install dpp:x64-windows
.vcpkg list dpp
. C:/vcpkg>vcpkg list dpp dpp:x64-windows 10.0.23 D++ Extremely Lightweight C++ Discord Library.
To use vcpkg in CLion, add the following line to your CMake options in the settings (Located under Settings > Build, Execution, Deployment > CMake)
-DCMAKE_TOOLCHAIN_FILE=path_to_vcpkg_root_folder/scripts/buildsystems/vcpkg.cmake
For example, if your root folder is C:/vcpkg/
then the CMake option will be:
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
Now proceed to add the following lines to your CMakeLists.txt
:
find_package(dpp CONFIG REQUIRED) target_link_libraries(main PRIVATE dpp::dpp) target_include_directories(main PRIVATE path_to_vcpkg_root_folder/installed/architecture-os/include)
For example, if your VCPKG root is C:/vcpkg/
, then your CMakeLists.txt
should look like this:
find_package(dpp CONFIG REQUIRED) target_link_libraries(main PRIVATE dpp::dpp) target_include_directories(main PRIVATE C:/vcpkg/installed/x64-windows/include)