From 51e658713ba186b31d6b96d4d043d2094778f2f7 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau Date: Fri, 20 Sep 2024 16:20:36 +0200 Subject: [PATCH 1/2] copy_on_error if symbolic link failed to be created --- src/python/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index cce1ea77d..c6c8ab9db 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -63,7 +63,9 @@ function( add_gudhi_symbolic_links GLOBBING_EXPRESSION ) endif() file(GLOB GUDHI_GLOB_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${GLOBBING_EXPRESSION}) foreach(GUDHI_GLOB_FILENAME ${GUDHI_GLOB_FILES}) - file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_GLOB_FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${GUDHI_GLOB_FILENAME}" SYMBOLIC) + # COPY_ON_ERROR is activated because on windows, user needs to be root or in dev mode to be able to make symbolic links + # This case can be problematic, because if you modify the sources, build is still done on the copy + file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_GLOB_FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${GUDHI_GLOB_FILENAME}" COPY_ON_ERROR SYMBOLIC) endforeach() endfunction( add_gudhi_symbolic_links ) From bfdbaeca78a5fd1b281720300ee98cdc59612167 Mon Sep 17 00:00:00 2001 From: Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:33:55 +0200 Subject: [PATCH 2/2] [comment review] symlinks creation restriction is only for win10 cf. https://www.howtogeek.com/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/ Co-authored-by: Marc Glisse --- src/python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index c6c8ab9db..e913af6b3 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -63,7 +63,7 @@ function( add_gudhi_symbolic_links GLOBBING_EXPRESSION ) endif() file(GLOB GUDHI_GLOB_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${GLOBBING_EXPRESSION}) foreach(GUDHI_GLOB_FILENAME ${GUDHI_GLOB_FILES}) - # COPY_ON_ERROR is activated because on windows, user needs to be root or in dev mode to be able to make symbolic links + # COPY_ON_ERROR is activated because on windows 10, user needs to be root or in dev mode to be able to make symbolic links # This case can be problematic, because if you modify the sources, build is still done on the copy file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_GLOB_FILENAME}" "${CMAKE_CURRENT_BINARY_DIR}/${GUDHI_GLOB_FILENAME}" COPY_ON_ERROR SYMBOLIC) endforeach()