diff --git a/README.md b/README.md index 18a83eb5d..163f08da7 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,37 @@ Linux or macOS users might follow the following instructions if they have a rece ``` +# Using Roaring as a CPM dependency + + +If you like CMake and CPM, you can just a few lines in you `CMakeLists.txt` file to grab a `CRoaring` release. [See our CPM demonstration for further details](https://github.com/RoaringBitmap/CPMdemo). + + + +```CMake +cmake_minimum_required(VERSION 3.10) +project(roaring_demo + LANGUAGES CXX C +) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_C_STANDARD 11) + +add_executable(hello hello.cpp) +# You can add CPM.cmake like so: +# mkdir -p cmake +# wget -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake +include(cmake/CPM.cmake) +CPMAddPackage( + NAME roaring + GITHUB_REPOSITORY "RoaringBitmap/CRoaring" + GIT_TAG v2.0.4 + OPTIONS "BUILD_TESTING OFF" +) + +target_link_libraries(hello roaring::roaring) +``` + + # Using as a CMake dependency If you like CMake, you can just a few lines in you `CMakeLists.txt` file to grab a `CRoaring` release. [See our demonstration for further details](https://github.com/RoaringBitmap/croaring_cmake_demo_single_file).