RAPIDS-CMake Basics

Installation

The rapids-cmake module is designed to be acquired via CMake’s Fetch Content into your project.

cmake_minimum_required(...)

file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.10/RAPIDS.cmake
  ${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
include(rapids-cpm)
include(rapids-cuda)
include(rapids-export)
include(rapids-find)

project(...)

Usage

rapids-cmake is designed for projects to use only the subset of features that they need. To enable this rapids-cmake comprises the following primary components:

There are two ways projects can use rapids-cmake functions.

  1. Call include(rapids-<component>), which imports commonly used functions for the component.

  2. Load each function independently via include(${rapids-cmake-dir}/<component>/<function_name>.cmake).