RAPIDS-CMake Basics ################### Installation ************ The ``rapids-cmake`` module is designed to be acquired at configure time in your project. Put the ``RAPIDS.cmake`` script, which handles fetching the rest of the module's content via CMake's `FetchContent `_, into your repository. .. code-block:: cmake cmake_minimum_required(...) include(${CMAKE_CURRENT_LIST_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: - :ref:`cmake ` - :ref:`cpm ` - :ref:`cython ` - :ref:`cuda ` - :ref:`export ` - :ref:`find ` - :ref:`testing ` There are two ways projects can use ``rapids-cmake`` functions. 1. Call ``include(rapids-)``, which imports commonly used functions for the component. 2. Load each function independently via ``include(${rapids-cmake-dir}//.cmake)``. Overriding RAPIDS.cmake *********************** At times projects or developers will need to verify ``rapids-cmake`` branches. To do this you can set variables that control which repository ``RAPIDS.cmake`` downloads, which should be done like this: .. code-block:: cmake # To set the version that is pulled (this must be set for RAPIDS.cmake to work): set(rapids-cmake-version "") # To override the GitHub repository: set(rapids-cmake-repo "") # To use an exact Git SHA: set(rapids-cmake-sha "") # To use a Git tag: set(rapids-cmake-tag "") # To override the repository branch: set(rapids-cmake-branch "") # Or to override the entire repository URL (e.g. to use a GitLab repo): set(rapids-cmake-url "https://gitlab.com///-/archive//-.zip") # To override the usage of fetching the repository without git info # This only works when specifying # # set(rapids-cmake-fetch-via-git "ON") # set(rapids-cmake-branch "branch-") # # or # set(rapids-cmake-fetch-via-git "ON") # set(rapids-cmake-url "https://gitlab.com///") # set(rapids-cmake-sha "ABC123") # set(rapids-cmake-fetch-via-git "ON") include(${CMAKE_CURRENT_LIST_DIR}/RAPIDS.cmake) A few notes: - An explicitly defined ``rapids-cmake-url`` will always be used - ``rapids-cmake-sha`` takes precedence over ``rapids-cmake-tag`` - ``rapids-cmake-tag`` takes precedence over ``rapids-cmake-branch`` - The CMake variable ``rapids-cmake-version`` must be set to a rapids-cmake version, formatted as ``MAJOR.MINOR`` - ``RAPIDS.cmake`` should be copied in and placed next to the above file