Merge topic 'BundleUtilities-make-dir'

200bf57742 BundleUtilities: Ensure target dir exists when creating symlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !2728
This commit is contained in:
Craig Scott 2019-01-09 21:41:27 +00:00 committed by Kitware Robot
commit 1fe3d126a5

View File

@ -717,6 +717,9 @@ function(link_resolved_item_into_bundle resolved_item resolved_embedded_item)
else()
get_filename_component(target_dir "${resolved_embedded_item}" DIRECTORY)
file(RELATIVE_PATH symlink_target "${target_dir}" "${resolved_item}")
if (NOT EXISTS "${target_dir}")
file(MAKE_DIRECTORY "${target_dir}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${symlink_target}" "${resolved_embedded_item}")
endif()
endfunction()