diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21cc0e882c..3958bf2884 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -258,12 +258,14 @@ else () else() set(BIN_RESOURCES_DIR "$/../Resources") endif() + # Create symlink for macOS bundle Resources directory + # Remove existing Resources if it exists (could be from previous build), then create symlink + add_custom_command(TARGET Snapmaker_Orca POST_BUILD + COMMAND sh -c "rm -rf \"$/../Resources\" || true" + COMMAND ${CMAKE_COMMAND} -E create_symlink "${SLIC3R_RESOURCES_DIR}" "$/../Resources" + COMMENT "Symlinking the resources directory into the build tree" + VERBATIM) endif() - add_custom_command(TARGET Snapmaker_Orca POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "$/../Resources" - COMMAND ${CMAKE_COMMAND} -E create_symlink "${SLIC3R_RESOURCES_DIR}" "$/../Resources" - COMMENT "Symlinking the resources directory into the build tree" - VERBATIM) endif () # Slic3r binary install target. Default build type is release in case no CMAKE_BUILD_TYPE is provided.