diff --git a/CMakeLists.txt b/CMakeLists.txt index 8be934b..a427c8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,28 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(GRAPH_BUILD_TESTS "Build arraylist tests" OFF) option(GRAPH_ENABLE_SANITIZERS "Enable sanitizers for tests" ON) +# -------------------------------------------------- +# CPM.cmake bootstrap +# -------------------------------------------------- + +set(CPM_DOWNLOAD_VERSION 0.40.2) + +set(CPM_DOWNLOAD_LOCATION + "${CMAKE_BINARY_DIR}/cmake/CPM.cmake" +) + +if(NOT EXISTS ${CPM_DOWNLOAD_LOCATION}) + message(STATUS "Downloading CPM.cmake...") + + file( + DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} + ) +endif() + +include(${CPM_DOWNLOAD_LOCATION}) + include(cmake/CPM.cmake) CPMAddPackage(