Skip to content

Commit

Permalink
Patch results are only displayed once per invocation of CMake (#292)
Browse files Browse the repository at this point in the history
Instead of showing the patch status for each call to `rapids_cpm_<pkg>` 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: #292
  • Loading branch information
robertmaynard authored Oct 14, 2022
1 parent c9a53df commit 2f27518
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions rapids-cmake/cpm/detail/display_patch_status.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 2f27518

Please sign in to comment.