Skip to content

Commit 3f22de3

Browse files
dirk-thomaswjwwood
authored andcommitted
add support for symlinked install on windows
1 parent 93de473 commit 3f22de3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install.cmake.in

+13-5
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,19 @@ function(_ament_cmake_symlink_create_symlink absolute_file symlink)
268268
file(REMOVE "${symlink}")
269269
endif()
270270

271-
execute_process(
272-
COMMAND "@CMAKE_COMMAND@" "-E" "create_symlink"
273-
"${absolute_file}"
274-
"${symlink}"
275-
)
271+
if(NOT WIN32)
272+
execute_process(
273+
COMMAND "@CMAKE_COMMAND@" "-E" "create_symlink"
274+
"${absolute_file}"
275+
"${symlink}"
276+
)
277+
else()
278+
execute_process(
279+
COMMAND "mklink"
280+
"${symlink}"
281+
"${absolute_file}"
282+
)
283+
endif()
276284
# the CMake command does not provide a return code so check manually
277285
if(NOT EXISTS "${symlink}" OR NOT IS_SYMLINK "${symlink}")
278286
get_filename_component(destination "${symlink}" REALPATH)

0 commit comments

Comments
 (0)