Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2645 from Naios/symbolic_link_error_pr
Fix cmake soft errors due to failing creation of links on windows
- Loading branch information
Showing
4 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) 2017 Denis Blank | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
# Creates a symbolic link from the destination to the target, | ||
# if the link doesn't exist yet. | ||
# Since `create_symlink` is only available for unix derivates, | ||
# we work around that in this macro. | ||
macro(create_symbolic_link SYM_TARGET SYM_DESTINATION) | ||
if(WIN32) | ||
if(NOT EXISTS ${SYM_DESTINATION}) | ||
# Create a junction for windows links | ||
execute_process(COMMAND cmd /C "${CMAKE_SOURCE_DIR}/cmake/scripts/create_symbolic_link.bat" | ||
${SYM_DESTINATION} ${SYM_TARGET}) | ||
endif() | ||
else() | ||
# Only available on unix derivates | ||
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ${SYM_TARGET} ${SYM_DESTINATION}) | ||
endif() | ||
endmacro(create_symbolic_link) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:: Copyright (c) 2017 Denis Blank | ||
:: | ||
:: Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
:: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
mklink /J "%1" "%2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters