|
16 | 16 | # |
17 | 17 | # This is the preferred entry point for projects using rapids-cmake |
18 | 18 | # |
| 19 | +# Enforce the minimum required CMake version for all users |
| 20 | +cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR) |
19 | 21 |
|
20 | 22 | # Allow users to control which version is used |
21 | | -if(NOT rapids-cmake-version) |
22 | | - # Define a default version if the user doesn't set one |
23 | | - set(rapids-cmake-version 25.04) |
| 23 | +if(NOT (rapids-cmake-branch OR rapids-cmake-version)) |
| 24 | + message(FATAL_ERROR "The CMake variable `rapids-cmake-branch` or `rapids-cmake-version` must be defined" |
| 25 | + ) |
24 | 26 | endif() |
25 | 27 |
|
26 | 28 | # Allow users to control which GitHub repo is fetched |
@@ -66,26 +68,18 @@ if(NOT rapids-cmake-url) |
66 | 68 | endif() |
67 | 69 | endif() |
68 | 70 |
|
69 | | -if(POLICY CMP0135) |
70 | | - cmake_policy(PUSH) |
71 | | - cmake_policy(SET CMP0135 NEW) |
72 | | -endif() |
73 | 71 | include(FetchContent) |
74 | 72 | if(rapids-cmake-fetch-via-git) |
75 | | - FetchContent_Declare(rapids-cmake |
76 | | - GIT_REPOSITORY "${rapids-cmake-url}" |
77 | | - GIT_TAG "${rapids-cmake-value-to-clone}") |
| 73 | + FetchContent_Declare(rapids-cmake GIT_REPOSITORY "${rapids-cmake-url}" |
| 74 | + GIT_TAG "${rapids-cmake-value-to-clone}") |
78 | 75 | else() |
79 | 76 | string(APPEND rapids-cmake-url "${rapids-cmake-value-to-clone}") |
80 | 77 | FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}") |
81 | 78 | endif() |
82 | | -if(POLICY CMP0135) |
83 | | - cmake_policy(POP) |
84 | | -endif() |
85 | 79 | FetchContent_GetProperties(rapids-cmake) |
86 | 80 | if(rapids-cmake_POPULATED) |
87 | | - # Something else has already populated rapids-cmake, only thing |
88 | | - # we need to do is setup the CMAKE_MODULE_PATH |
| 81 | + # Something else has already populated rapids-cmake, only thing we need to do is setup the |
| 82 | + # CMAKE_MODULE_PATH |
89 | 83 | if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH) |
90 | 84 | list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}") |
91 | 85 | endif() |
|
0 commit comments