Skip to content

Commit

Permalink
Glob for all libs and symlinks in mac os and then copy them using cma…
Browse files Browse the repository at this point in the history
…ke natively
  • Loading branch information
vijaiaeroastro committed Jun 2, 2024
1 parent 612d788 commit 2662a2e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmake/lib3mfConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ else()
if(TARGET ${target})
if(APPLE)
# On macOS, copy .dylib files, preserving symlinks only if they don't already exist in the target directory
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${lib3mf_LIBRARY_DIR}/lib3mf.dylib" "$<TARGET_FILE_DIR:${target}>"
COMMENT "Copying lib3mf.dylib to target directory on macOS")
file(GLOB LIB3MF_FILES "${lib3mf_LIBRARY_DIR}/lib3mf.dylib*")
foreach(file ${LIB3MF_FILES})
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${file}" "$<TARGET_FILE_DIR:${target}>/$(basename ${file})"
COMMENT "Copying $(basename ${file}) to target directory on macOS if it is different")
endforeach()


elseif(UNIX)
Expand Down

0 comments on commit 2662a2e

Please sign in to comment.