Skip to content

Commit

Permalink
Make patch command a string and always quote it
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Jan 16, 2024
1 parent 53fef56 commit d119bc6
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 25 deletions.
6 changes: 4 additions & 2 deletions rapids-cmake/cpm/cccl.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-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.
Expand Down Expand Up @@ -66,6 +66,7 @@ function(rapids_cpm_cccl)
rapids_cpm_package_details(CCCL version repository tag shallow exclude)

set(to_install OFF)
cmake_policy(SET CMP0057 NEW)
if(INSTALL_EXPORT_SET IN_LIST ARGN AND NOT exclude)
set(to_install ON)
# Make sure we install CCCL into the `include/rapids` subdirectory instead of the default
Expand All @@ -82,13 +83,14 @@ function(rapids_cpm_cccl)
set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL ON)

include("${rapids-cmake-dir}/cpm/find.cmake")
message("The patch command inside is ${patch_command}")
rapids_cpm_find(CCCL ${version} ${ARGN}
GLOBAL_TARGETS CCCL CCCL::CCCL CCCL::CUB CCCL::libcudacxx
CPM_ARGS FIND_PACKAGE_ARGUMENTS EXACT
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "CCCL_ENABLE_INSTALL_RULES ${to_install}")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/cuco.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-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.
Expand Down Expand Up @@ -81,7 +81,7 @@ function(rapids_cpm_cuco)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${to_exclude}
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF"
"INSTALL_CUCO ${to_install}")
Expand Down
2 changes: 1 addition & 1 deletion rapids-cmake/cpm/detail/generate_patch_command.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function(rapids_cpm_generate_patch_command package_name version patch_command)
string(TIMESTAMP current_year "%Y" UTC)
configure_file(${rapids-cmake-dir}/cpm/patches/command_template.cmake.in "${patch_script}"
@ONLY)
set(${patch_command} ${CMAKE_COMMAND} -P ${patch_script} PARENT_SCOPE)
set(${patch_command} "${CMAKE_COMMAND} -P ${patch_script}" PARENT_SCOPE)
else()
# remove any old patch / log files that exist and are no longer needed due to a change in the
# package version / version.json
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/find.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ modified version is used.
function(rapids_cpm_find name version)
list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.find")
set(options CPM_ARGS)
set(one_value BUILD_EXPORT_SET INSTALL_EXPORT_SET)
set(multi_value COMPONENTS GLOBAL_TARGETS PATCH_COMMAND)
set(one_value BUILD_EXPORT_SET INSTALL_EXPORT_SET PATCH_COMMAND)
set(multi_value COMPONENTS GLOBAL_TARGETS)
cmake_parse_arguments(_RAPIDS "${options}" "${one_value}" "${multi_value}" ${ARGN})

if(NOT DEFINED _RAPIDS_CPM_ARGS)
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/fmt.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-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.
Expand Down Expand Up @@ -69,7 +69,7 @@ function(rapids_cpm_fmt)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "FMT_INSTALL ${to_install}" "CMAKE_POSITION_INDEPENDENT_CODE ON")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/gbench.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-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.
Expand Down Expand Up @@ -78,7 +78,7 @@ function(rapids_cpm_gbench)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "BENCHMARK_ENABLE_GTEST_TESTS OFF" "BENCHMARK_ENABLE_TESTING OFF"
"BENCHMARK_ENABLE_INSTALL ${to_install}"
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/gtest.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -69,7 +69,7 @@ function(rapids_cpm_gtest)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "INSTALL_GTEST ${to_install}" "CMAKE_POSITION_INDEPENDENT_CODE ON")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/libcudacxx.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -89,7 +89,7 @@ function(rapids_cpm_libcudacxx)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "libcudacxx_ENABLE_INSTALL_RULES ${to_install}")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/nvbench.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -95,7 +95,7 @@ function(rapids_cpm_nvbench)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "NVBench_ENABLE_NVML ${nvbench_with_nvml}"
"NVBench_ENABLE_CUPTI OFF"
Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/nvcomp.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -145,7 +145,7 @@ function(rapids_cpm_nvcomp)
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
EXCLUDE_FROM_ALL ${to_exclude}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
OPTIONS "BUILD_STATIC ON" "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF"
"BUILD_EXAMPLES OFF")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/rmm.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -78,7 +78,7 @@ function(rapids_cpm_rmm)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${to_exclude}
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/spdlog.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -130,7 +130,7 @@ function(rapids_cpm_spdlog)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "SPDLOG_INSTALL ${to_install}" "${spdlog_fmt_option}")

Expand Down
4 changes: 2 additions & 2 deletions rapids-cmake/cpm/thrust.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-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.
Expand Down Expand Up @@ -85,7 +85,7 @@ function(rapids_cpm_thrust NAMESPACE namespaces_name)
GIT_REPOSITORY ${repository}
GIT_TAG ${tag}
GIT_SHALLOW ${shallow}
PATCH_COMMAND ${patch_command}
PATCH_COMMAND "${patch_command}"
EXCLUDE_FROM_ALL ${exclude}
OPTIONS "THRUST_ENABLE_INSTALL_RULES ${to_install}")

Expand Down

0 comments on commit d119bc6

Please sign in to comment.