From 3dffac2ec88799479d03ecfe3a2070cd62661734 Mon Sep 17 00:00:00 2001 From: Josiah Bills Date: Fri, 26 May 2023 16:45:30 -0400 Subject: [PATCH] Fixed legacy byproduct copy. --- cmake/Corrosion.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Corrosion.cmake b/cmake/Corrosion.cmake index d48eb203..fbea65f4 100644 --- a/cmake/Corrosion.cmake +++ b/cmake/Corrosion.cmake @@ -232,10 +232,12 @@ function(_corrosion_copy_byproduct_legacy target_name cargo_build_dir file_names set(output_dir "${CMAKE_CURRENT_BINARY_DIR}") endif() + string(REPLACE "::" "__" target_name_cmake_underscore ${target_name}) + list(TRANSFORM file_names PREPEND "${cargo_build_dir}/" OUTPUT_VARIABLE src_file_names) list(TRANSFORM file_names PREPEND "${output_dir}/" OUTPUT_VARIABLE dst_file_names) message(DEBUG "Adding command to copy byproducts `${file_names}` to ${dst_file_names}") - add_custom_command(TARGET _cargo-build_${target_name} + add_custom_command(TARGET _cargo-build_${target_name_cmake_underscore} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${output_dir}" COMMAND