-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
command line overrides still allow rapids_cmake_override to work when…
… they have no set intersection
- Loading branch information
1 parent
89019b6
commit f240c83
Showing
4 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,69 @@ | ||
#============================================================================= | ||
# Copyright (c) 2024, 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. | ||
#============================================================================= | ||
include(${rapids-cmake-dir}/cpm/init.cmake) | ||
include(${rapids-cmake-dir}/cpm/package_override.cmake) | ||
|
||
# Need to write out an override file | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override1.json | ||
[=[ | ||
{ | ||
"packages": { | ||
"nvbench": { | ||
"git_tag": "my_tag" | ||
}, | ||
"GTest": { | ||
"version": "2.99" | ||
} | ||
} | ||
} | ||
]=]) | ||
|
||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override2.json | ||
[=[ | ||
{ | ||
"packages": { | ||
"rmm": { | ||
"git_tag": "new_rmm_tag" | ||
}, | ||
"GTest": { | ||
"version": "3.99" | ||
} | ||
} | ||
} | ||
]=]) | ||
|
||
set(RAPIDS_CMAKE_CPM_OVERRIDE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/override1.json") | ||
rapids_cpm_init() | ||
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override2.json) | ||
|
||
# Verify that the override works | ||
rapids_cpm_package_details(nvbench version repository tag shallow exclude) | ||
if(NOT tag STREQUAL "my_tag") | ||
message(FATAL_ERROR "custom git_tag field was ignored. ${tag} found instead of my_url") | ||
endif() | ||
|
||
rapids_cpm_package_details(GTest version repository tag shallow exclude) | ||
if(NOT version STREQUAL "2.99") | ||
message(FATAL_ERROR "custom version field was removed. ${version} was found instead") | ||
endif() | ||
if(NOT tag MATCHES "2.99") | ||
message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead") | ||
endif() | ||
|
||
rapids_cpm_package_details(rmm version repository tag shallow exclude) | ||
if(NOT tag MATCHES "new_rmm_tag") | ||
message(FATAL_ERROR "custom version field not used when computing git_tag value. ${tag} was found instead") | ||
endif() |