From 92f398e16c62c76c3117839d0879ba74068f7f73 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 14 Oct 2022 09:21:59 -0400 Subject: [PATCH 1/2] Patch results are only displayed once per invocation of CMake Instead of showing the patch status for each call to `rapids_cpm_` only display it on the first. This makes it clearer that we aren't applying the patches multiple times. --- .../cpm/detail/display_patch_status.cmake | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rapids-cmake/cpm/detail/display_patch_status.cmake b/rapids-cmake/cpm/detail/display_patch_status.cmake index a001616b..06065e41 100644 --- a/rapids-cmake/cpm/detail/display_patch_status.cmake +++ b/rapids-cmake/cpm/detail/display_patch_status.cmake @@ -29,12 +29,16 @@ Displays the result of any patches applied to the requested package #]=======================================================================] function(rapids_cpm_display_patch_status package_name) - list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.display_patch_status") - set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${package_name}/log") - if(EXISTS "${log_file}") - file(STRINGS "${log_file}" contents) - foreach(line IN LISTS contents) - message(STATUS "${line}") - endforeach() + # Only display the status information on the first execution of + # the call + if(${package_name}_ADDED) + list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.display_patch_status") + set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${package_name}/log") + if(EXISTS "${log_file}") + file(STRINGS "${log_file}" contents) + foreach(line IN LISTS contents) + message(STATUS "${line}") + endforeach() + endif() endif() endfunction() From 815d73d42bc5bee80cf2d1ee09a30e4bbb358589 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 14 Oct 2022 10:01:25 -0400 Subject: [PATCH 2/2] Correct style issues found by CI --- rapids-cmake/cpm/detail/display_patch_status.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rapids-cmake/cpm/detail/display_patch_status.cmake b/rapids-cmake/cpm/detail/display_patch_status.cmake index 06065e41..2142d01e 100644 --- a/rapids-cmake/cpm/detail/display_patch_status.cmake +++ b/rapids-cmake/cpm/detail/display_patch_status.cmake @@ -29,8 +29,7 @@ Displays the result of any patches applied to the requested package #]=======================================================================] function(rapids_cpm_display_patch_status package_name) - # Only display the status information on the first execution of - # the call + # Only display the status information on the first execution of the call if(${package_name}_ADDED) list(APPEND CMAKE_MESSAGE_CONTEXT "rapids.cpm.display_patch_status") set(log_file "${CMAKE_BINARY_DIR}/rapids-cmake/patches/${package_name}/log")