From bbcebc34e00e8473bb123bdf933a8d81792f8fcb Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Sun, 2 Jun 2024 19:56:10 +0530 Subject: [PATCH] Change copy lib3mf libraries functions slightly in OSX --- cmake/lib3mfConfig.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/lib3mfConfig.cmake b/cmake/lib3mfConfig.cmake index 112d8ad07..c232b8c0a 100644 --- a/cmake/lib3mfConfig.cmake +++ b/cmake/lib3mfConfig.cmake @@ -79,8 +79,9 @@ else() if(APPLE) # On macOS, copy .dylib files, preserving symlinks add_custom_command(TARGET ${target} POST_BUILD - COMMAND sh -c "cp -P '${lib3mf_LIBRARY_DIR}/lib3mf.dylib'* '$'" + COMMAND sh -c "if [ ! -f '$/lib3mf.dylib' ]; then cp -P '${lib3mf_LIBRARY_DIR}/lib3mf.dylib'* '$'; fi" COMMENT "Copying all lib3mf library files to target directory on MacOS") + elseif(UNIX) # On Unix-like systems (excluding macOS), copy .so files, preserving symlinks add_custom_command(TARGET ${target} POST_BUILD