From 37e165d82d89767dfd18b63592a2bab8c5dea11f Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Mon, 22 Oct 2018 11:50:05 +0200 Subject: [PATCH] Build: Fix resources symlink --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 330134c3b..332649cf9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -119,28 +119,28 @@ if (MSVC) 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}/resources" WIN_RESOURCES_SYMLINK) - add_custom_target("resources_symlink_${CONF}" ALL - DEPENDS slic3r + add_custom_command(TARGET slic3r POST_BUILD COMMAND if exist "${WIN_CONF_OUTPUT_DIR}" "(" 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 ) endforeach () else () file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK) - add_custom_target(resources_symlink ALL - DEPENDS slic3r + add_custom_command(TARGET slic3r POST_BUILD 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 ) endif () else () - add_custom_target(resources_symlink ALL - DEPENDS slic3r + add_custom_command(TARGET slic3r POST_BUILD COMMAND ln -sf "${SLIC3R_RESOURCES_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/../resources" + COMMENT "Symlinking the resources directory into the build tree" VERBATIM ) endif()