summaryrefslogtreecommitdiffstats
path: root/Modules/BundleUtilities.cmake
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2018-12-11 15:48:53 (GMT)
committerCraig Scott <craig.scott@crascit.com>2019-01-08 08:56:34 (GMT)
commit200bf5774285d51d9c5f24b5b52226a7cb54d33d (patch)
treef4d43c4367669c13d07d35d17765ea1bc1670c9d /Modules/BundleUtilities.cmake
parent9bbfbd54ba04e07b0bf2eb8bb1056bca53d639c5 (diff)
downloadCMake-200bf5774285d51d9c5f24b5b52226a7cb54d33d.zip
CMake-200bf5774285d51d9c5f24b5b52226a7cb54d33d.tar.gz
CMake-200bf5774285d51d9c5f24b5b52226a7cb54d33d.tar.bz2
BundleUtilities: Ensure target dir exists when creating symlinks
Commit v3.13.0-rc1~279^2 (GetPrerequisites: Move dylibs from MacOS to Frameworks folder in bundle, 2018-07-22) introduced a regression that can cause symlink creation to fail during packaging. Symlinks can be created before targets are installed, so the destination directory of the symlink sometimes won't exist at symlink creation. Fixes: #18726
Diffstat (limited to 'Modules/BundleUtilities.cmake')
-rw-r--r--Modules/BundleUtilities.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 613ba1a..89ca918 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -720,6 +720,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()