From 232339eed0f04d6325443747faefabd4aa059289 Mon Sep 17 00:00:00 2001 From: Sean Yen Date: Thu, 23 Jul 2020 15:45:12 -0700 Subject: [PATCH] [noetic-devel][Windows] Fix file COPY cannot read symlink (#1109) * conditionally file copying on Windows. * fix condition Co-authored-by: Dirk Thomas --- cmake/catkin_install_python.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/catkin_install_python.cmake b/cmake/catkin_install_python.cmake index 3b5026963..cc9cde68a 100644 --- a/cmake/catkin_install_python.cmake +++ b/cmake/catkin_install_python.cmake @@ -40,7 +40,10 @@ function(catkin_install_python signature) file(MAKE_DIRECTORY ${rewritten_file}) # even though the content of the file is overwritten # the copy makes sure the file has the right permissions - file(COPY ${source_file} DESTINATION ${rewritten_file} USE_SOURCE_PERMISSIONS) + if(NOT WIN32 OR NOT IS_SYMLINK "${source_file}") + # CMake doesn't support copying symlinks on Windows + file(COPY ${source_file} DESTINATION ${rewritten_file} USE_SOURCE_PERMISSIONS) + endif() set(rewritten_file "${rewritten_file}/${filename}") file(WRITE ${rewritten_file} "${data}") else()