From 3f22de31caecb1fb4eacc7fa02500e568de8c0e3 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Fri, 20 Mar 2015 17:10:34 -0700 Subject: [PATCH] add support for symlinked install on windows --- .../ament_cmake_symlink_install.cmake.in | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install.cmake.in b/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install.cmake.in index 510f190c..afbd3e71 100644 --- a/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install.cmake.in +++ b/ament_cmake_core/cmake/symlink_install/ament_cmake_symlink_install.cmake.in @@ -268,11 +268,19 @@ function(_ament_cmake_symlink_create_symlink absolute_file symlink) file(REMOVE "${symlink}") endif() - execute_process( - COMMAND "@CMAKE_COMMAND@" "-E" "create_symlink" - "${absolute_file}" - "${symlink}" - ) + if(NOT WIN32) + execute_process( + COMMAND "@CMAKE_COMMAND@" "-E" "create_symlink" + "${absolute_file}" + "${symlink}" + ) + else() + execute_process( + COMMAND "mklink" + "${symlink}" + "${absolute_file}" + ) + endif() # the CMake command does not provide a return code so check manually if(NOT EXISTS "${symlink}" OR NOT IS_SYMLINK "${symlink}") get_filename_component(destination "${symlink}" REALPATH)