-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-23.10' into fea/update-to-cpm-v0.38.5
- Loading branch information
Showing
3 changed files
with
74 additions
and
3 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
64 changes: 64 additions & 0 deletions
64
testing/cpm/cpm_package_override-obey-cpm-source-var.cmake
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,64 @@ | ||
#============================================================================= | ||
# Copyright (c) 2021-2023, 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) | ||
|
||
rapids_cpm_init() | ||
|
||
# Need to write out an override file | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json | ||
[=[ | ||
{ | ||
"packages" : { | ||
"rmm" : { | ||
"git_url" : "new_rmm_url", | ||
"git_shallow" : "OFF", | ||
"exclude_from_all" : "ON" | ||
}, | ||
"not_in_base" : { | ||
"git_url" : "new_rmm_url", | ||
"git_shallow" : "OFF", | ||
"exclude_from_all" : "ON" | ||
} | ||
} | ||
} | ||
]=]) | ||
|
||
set(CPM_rmm_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") | ||
set(CPM_not_in_base_SOURCE "${CMAKE_CURRENT_BINARY_DIR}") | ||
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) | ||
|
||
# Verify that the override doesn't exist due to `CPM_rmm_SOURCE` | ||
include("${rapids-cmake-dir}/cpm/detail/package_details.cmake") | ||
|
||
rapids_cpm_package_details(rmm version repository tag shallow exclude) | ||
if(repository MATCHES "new_rmm_url") | ||
message(FATAL_ERROR "custom url field should not be set, due to CPM_rmm_SOURCE") | ||
endif() | ||
if(shallow MATCHES "OFF") | ||
message(FATAL_ERROR "shallow field should not be set, due to CPM_rmm_SOURCE") | ||
endif() | ||
if(CPM_DOWNLOAD_ALL) | ||
message(FATAL_ERROR "CPM_DOWNLOAD_ALL should not be set, due to CPM_rmm_SOURCE") | ||
endif() | ||
|
||
unset(version) | ||
unset(repository) | ||
unset(tag) | ||
rapids_cpm_package_details(not_in_base version repository tag shallow exclude) | ||
if(version OR repository OR tag) | ||
message(FATAL_ERROR "rapids_cpm_package_details should not return anything for package that doesn't exist") | ||
endif() |