Skip to content

Commit aabfe48

Browse files
committed
rapids_config will use RAPIDS_BRANCH contents to determine what branch to use
1 parent b915319 commit aabfe48

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

RAPIDS_BRANCH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
25.10
1+
branch-25.10

cmake/RAPIDS.cmake

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
1919

2020
# Allow users to control which version is used
21-
if(NOT rapids-cmake-version OR NOT rapids-cmake-version MATCHES [[^([0-9][0-9])\.([0-9][0-9])$]])
22-
Use STRINGS to trim whitespace/newlines
23-
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH" _rapids_branch)
21+
if(NOT rapids-cmake-branch OR NOT rapids-cmake-version)
2422
message(
2523
FATAL_ERROR "The CMake variable `rapids-cmake-branch` or `rapids-cmake-version` must be defined"
2624
)
@@ -74,8 +72,7 @@ if(rapids-cmake-fetch-via-git)
7472
FetchContent_Declare(
7573
rapids-cmake
7674
GIT_REPOSITORY "${rapids-cmake-url}"
77-
GIT_TAG "${rapids-cmake-value-to-clone}"
78-
)
75+
GIT_TAG "${rapids-cmake-value-to-clone}")
7976
else()
8077
string(APPEND rapids-cmake-url "${rapids-cmake-value-to-clone}")
8178
FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}")

cmake/rapids_config.cmake

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# the License.
1313
# =============================================================================
1414
file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION" _rapids_version)
15-
# Use STRINGS to trim whitespace/newlines
16-
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH" _rapids_branch)
1715
if(_rapids_version MATCHES [[^([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9])]])
1816
set(RAPIDS_VERSION_MAJOR "${CMAKE_MATCH_1}")
1917
set(RAPIDS_VERSION_MINOR "${CMAKE_MATCH_2}")
@@ -24,13 +22,18 @@ else()
2422
string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}")
2523
message(
2624
FATAL_ERROR
27-
"Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}"
28-
)
25+
"Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}")
2926
endif()
3027

31-
set(rapids-cmake-version "${RAPIDS_VERSION_MAJOR_MINOR}")
28+
# Use STRINGS to trim whitespace/newlines
29+
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH" _rapids_branch)
3230
if(NOT _rapids_branch)
33-
message(FATAL_ERROR "Could not determine branch name to use for checking out rapids-cmake. The file "${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH" is missing.")
31+
message(
32+
FATAL_ERROR
33+
"Could not determine branch name to use for checking out rapids-cmake. The file \"${CMAKE_CURRENT_LIST_DIR}/../RAPIDS_BRANCH\" is missing."
34+
)
3435
endif()
36+
37+
set(rapids-cmake-version "${RAPIDS_VERSION_MAJOR_MINOR}")
3538
set(rapids-cmake-branch "${_rapids_branch}")
3639
include("${CMAKE_CURRENT_LIST_DIR}/RAPIDS.cmake")

0 commit comments

Comments
 (0)