Build: Fix resources symlink

This commit is contained in:
Vojtech Kral 2018-10-22 11:50:05 +02:00
parent 974e2056fb
commit 37e165d82d

View File

@ -119,28 +119,28 @@ if (MSVC)
foreach (CONF ${CMAKE_CONFIGURATION_TYPES}) foreach (CONF ${CMAKE_CONFIGURATION_TYPES})
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}" WIN_CONF_OUTPUT_DIR) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}" WIN_CONF_OUTPUT_DIR)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}/resources" WIN_RESOURCES_SYMLINK) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}/resources" WIN_RESOURCES_SYMLINK)
add_custom_target("resources_symlink_${CONF}" ALL add_custom_command(TARGET slic3r POST_BUILD
DEPENDS slic3r
COMMAND if exist "${WIN_CONF_OUTPUT_DIR}" "(" COMMAND if exist "${WIN_CONF_OUTPUT_DIR}" "("
if not exist "${WIN_RESOURCES_SYMLINK}" "(" if not exist "${WIN_RESOURCES_SYMLINK}" "("
mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}" mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}"
")" ")"
")" ")"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM VERBATIM
) )
endforeach () endforeach ()
else () else ()
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK)
add_custom_target(resources_symlink ALL add_custom_command(TARGET slic3r POST_BUILD
DEPENDS slic3r
COMMAND if not exist "${WIN_RESOURCES_SYMLINK}" "(" mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}" ")" COMMAND if not exist "${WIN_RESOURCES_SYMLINK}" "(" mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}" ")"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM VERBATIM
) )
endif () endif ()
else () else ()
add_custom_target(resources_symlink ALL add_custom_command(TARGET slic3r POST_BUILD
DEPENDS slic3r
COMMAND ln -sf "${SLIC3R_RESOURCES_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/../resources" COMMAND ln -sf "${SLIC3R_RESOURCES_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/../resources"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM VERBATIM
) )
endif() endif()