From d866abe377932723cfed3b77fcee4f20edf555ee Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Thu, 7 Jun 2018 11:55:50 +0100 Subject: [PATCH 1/2] Fix out-of-tree testing symlinks on Windows --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9e791344..11a62e2a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,11 @@ function(link_to_source base_name) if (CMAKE_HOST_UNIX) set(command ln -s ${target} ${link}) else() - set(command cmd.exe /c mklink /j ${link} ${target}) + if (IS_DIRECTORY ${target}) + set(command cmd.exe /c mklink /j ${link} ${target}) + else() + set(command cmd.exe /c mklink ${link} ${target}) + endif() endif() execute_process(COMMAND ${command} From 48417677833df75009ca878477957a347bf6d7e0 Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Fri, 8 Jun 2018 10:07:32 +0100 Subject: [PATCH 2/2] Change symlink to hardlink to avoid permission issues --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11a62e2a0..ecacc7ade 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ function(link_to_source base_name) if (IS_DIRECTORY ${target}) set(command cmd.exe /c mklink /j ${link} ${target}) else() - set(command cmd.exe /c mklink ${link} ${target}) + set(command cmd.exe /c mklink /h ${link} ${target}) endif() endif()