From 2f275187597f0a22b5b7f68eb1f9cc448ba39f90 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 14 Oct 2022 13:22:27 -0400 Subject: [PATCH] Patch results are only displayed once per invocation of CMake (#292) 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. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/rapids-cmake/pull/292 --- .../cpm/detail/display_patch_status.cmake | 17 ++++++++++------- 1 file changed, 10 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..2142d01e 100644 --- a/rapids-cmake/cpm/detail/display_patch_status.cmake +++ b/rapids-cmake/cpm/detail/display_patch_status.cmake @@ -29,12 +29,15 @@ 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()