-
Notifications
You must be signed in to change notification settings - Fork 184
Vendor RAPIDS.cmake #816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Vendor RAPIDS.cmake #816
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # ============================================================================= | ||
| # Copyright (c) 2021-2025, NVIDIA CORPORATION. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
| # in compliance with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software distributed under the License | ||
| # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
| # or implied. See the License for the specific language governing permissions and limitations under | ||
| # the License. | ||
| # ============================================================================= | ||
| # | ||
| # This is the preferred entry point for projects using rapids-cmake | ||
| # | ||
| # Enforce the minimum required CMake version for all users | ||
| cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR) | ||
|
|
||
| # Allow users to control which version is used | ||
| if(NOT rapids-cmake-version OR NOT rapids-cmake-version MATCHES [[^([0-9][0-9])\.([0-9][0-9])$]]) | ||
| message( | ||
| FATAL_ERROR "The CMake variable rapids-cmake-version must be defined in the format MAJOR.MINOR." | ||
| ) | ||
| endif() | ||
|
|
||
| # Allow users to control which GitHub repo is fetched | ||
| if(NOT rapids-cmake-repo) | ||
| # Define a default repo if the user doesn't set one | ||
| set(rapids-cmake-repo rapidsai/rapids-cmake) | ||
| endif() | ||
|
|
||
| # Allow users to control which branch is fetched | ||
| if(NOT rapids-cmake-branch) | ||
| # Define a default branch if the user doesn't set one | ||
| set(rapids-cmake-branch "branch-${rapids-cmake-version}") | ||
| endif() | ||
|
|
||
| # Allow users to control the exact URL passed to FetchContent | ||
| if(NOT rapids-cmake-url) | ||
| # Construct a default URL if the user doesn't set one | ||
| set(rapids-cmake-url "https://github.com/${rapids-cmake-repo}/") | ||
|
|
||
| # In order of specificity | ||
| if(rapids-cmake-fetch-via-git) | ||
| if(rapids-cmake-sha) | ||
| # An exact git SHA takes precedence over anything | ||
| set(rapids-cmake-value-to-clone "${rapids-cmake-sha}") | ||
| elseif(rapids-cmake-tag) | ||
| # Followed by a git tag name | ||
| set(rapids-cmake-value-to-clone "${rapids-cmake-tag}") | ||
| else() | ||
| # Or if neither of the above two were defined, use a branch | ||
| set(rapids-cmake-value-to-clone "${rapids-cmake-branch}") | ||
| endif() | ||
| else() | ||
| if(rapids-cmake-sha) | ||
| # An exact git SHA takes precedence over anything | ||
| set(rapids-cmake-value-to-clone "archive/${rapids-cmake-sha}.zip") | ||
| elseif(rapids-cmake-tag) | ||
| # Followed by a git tag name | ||
| set(rapids-cmake-value-to-clone "archive/refs/tags/${rapids-cmake-tag}.zip") | ||
| else() | ||
| # Or if neither of the above two were defined, use a branch | ||
| set(rapids-cmake-value-to-clone "archive/refs/heads/${rapids-cmake-branch}.zip") | ||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
||
| include(FetchContent) | ||
| if(rapids-cmake-fetch-via-git) | ||
| FetchContent_Declare( | ||
| rapids-cmake | ||
| GIT_REPOSITORY "${rapids-cmake-url}" | ||
| GIT_TAG "${rapids-cmake-value-to-clone}" | ||
| ) | ||
| else() | ||
| string(APPEND rapids-cmake-url "${rapids-cmake-value-to-clone}") | ||
| FetchContent_Declare(rapids-cmake URL "${rapids-cmake-url}") | ||
| endif() | ||
| FetchContent_GetProperties(rapids-cmake) | ||
| if(rapids-cmake_POPULATED) | ||
| # Something else has already populated rapids-cmake, only thing we need to do is setup the | ||
| # CMAKE_MODULE_PATH | ||
| if(NOT "${rapids-cmake-dir}" IN_LIST CMAKE_MODULE_PATH) | ||
| list(APPEND CMAKE_MODULE_PATH "${rapids-cmake-dir}") | ||
| endif() | ||
| else() | ||
| FetchContent_MakeAvailable(rapids-cmake) | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.