-
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.
Browse files
Browse the repository at this point in the history
closes #325 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: #519
- Loading branch information
1 parent
d18367a
commit 9798e7d
Showing
17 changed files
with
186 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
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
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
51 changes: 51 additions & 0 deletions
51
testing/cpm/cpm_generate_patch_command-verify-copyright-header.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,51 @@ | ||
#============================================================================= | ||
# 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) | ||
include(${rapids-cmake-dir}/cpm/detail/generate_patch_command.cmake) | ||
include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) | ||
|
||
rapids_cpm_init() | ||
|
||
# Need to write out an override file | ||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/override.json | ||
[=[ | ||
{ | ||
"packages" : { | ||
"pkg_with_patch" : { | ||
"version" : "10.2", | ||
"git_tag" : "a_tag", | ||
"git_shallow" : "OFF", | ||
"exclude_from_all" : "ON", | ||
"patches" : [ | ||
{ | ||
"file" : "e/example.diff", | ||
"issue" : "explain", | ||
"fixed_in" : "" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
]=]) | ||
rapids_cpm_package_override(${CMAKE_CURRENT_BINARY_DIR}/override.json) | ||
|
||
rapids_cpm_generate_patch_command(pkg_with_patch 10.2 patch_command) | ||
if(NOT patch_command) | ||
message(FATAL_ERROR "rapids_cpm_package_override specified a patch step for `pkg_with_patch`") | ||
endif() | ||
|
||
check_copyright_header("${CMAKE_BINARY_DIR}/rapids-cmake/patches/pkg_with_patch/patch.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
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,46 @@ | ||
#============================================================================= | ||
# 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}/export/cpm.cmake) | ||
include(${rapids-cmake-dir}/export/export.cmake) | ||
include(${rapids-cmake-dir}/export/write_dependencies.cmake) | ||
include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) | ||
|
||
cmake_minimum_required(VERSION 3.23.1) | ||
project(FakEProJecT LANGUAGES CXX VERSION 3.1.4) | ||
|
||
add_library(fakeLib INTERFACE) | ||
install(TARGETS fakeLib EXPORT fake_set) | ||
|
||
rapids_export_cpm(BUILD RaFT FakEProJecT | ||
CPM_ARGS | ||
FAKE_PACKAGE_ARGS TRUE | ||
) | ||
|
||
rapids_export_write_dependencies(BUILD FakEProJecT dependencies.cmake) | ||
|
||
rapids_export(BUILD FakEProJecT | ||
EXPORT_SET fake_set | ||
NAMESPACE test:: | ||
) | ||
rapids_export(INSTALL FakEProJecT | ||
EXPORT_SET fake_set | ||
NAMESPACE test:: | ||
) | ||
|
||
check_copyright_header("${CMAKE_BINARY_DIR}/fakeproject-config.cmake") | ||
check_copyright_header("${CMAKE_BINARY_DIR}/rapids-cmake/fakeproject/export/fakeproject/fakeproject-config.cmake") | ||
check_copyright_header("${CMAKE_BINARY_DIR}/rapids-cmake/FakEProJecT/build/cpm_RaFT.cmake") | ||
check_copyright_header("${CMAKE_BINARY_DIR}/dependencies.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
24 changes: 24 additions & 0 deletions
24
testing/find/find_generate_module-verify-copyright-header.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,24 @@ | ||
#============================================================================= | ||
# 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}/find/generate_module.cmake) | ||
include(${rapids-cmake-testing-dir}/utils/check_copyright_header.cmake) | ||
|
||
rapids_find_generate_module( RapidsTest | ||
HEADER_NAMES rapids-cmake-test-header_only.hpp | ||
INSTALL_EXPORT_SET test_set | ||
) | ||
|
||
check_copyright_header("${CMAKE_BINARY_DIR}/cmake/find_modules/FindRapidsTest.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,42 @@ | ||
#============================================================================= | ||
# 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_guard(GLOBAL) | ||
|
||
function(check_copyright_header file) | ||
string(TIMESTAMP current_year "%Y" UTC) | ||
string(CONFIGURE [=[#============================================================================= | ||
# Copyright (c) @current_year@, 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. | ||
#============================================================================= | ||
]=] expected_header @ONLY) | ||
string(LENGTH "${expected_header}" expected_header_length) | ||
|
||
file(READ "${file}" actual_header LIMIT "${expected_header_length}") | ||
if(NOT actual_header STREQUAL expected_header) | ||
message(FATAL_ERROR "File ${file} did not have expected copyright header") | ||
endif() | ||
endfunction() |