From 675cfedb8af74c14ce30759f1d6193f954b88f7b Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Thu, 1 Sep 2022 12:27:08 -0400
Subject: [PATCH] DRTVWR-568: Ensure parent directory exists before
 CREATE_LINK.

---
 indra/cmake/Copy3rdPartyLibs.cmake | 1 +
 indra/test/CMakeLists.txt          | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index c2e1bb4b85c..edf02bec2b9 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -154,6 +154,7 @@ elseif(DARWIN)
     # Support our "@executable_path/../Resources" load path for executables
     # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE
     # directories.
+    file(MAKE_DIRECTORY "${SHARED_LIB_STAGING_DIR}")
     file(CREATE_LINK "Release/Resources" "${SHARED_LIB_STAGING_DIR}/Resources"
          SYMBOLIC)
 
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 161e9577847..9e65ceb926a 100644
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -121,6 +121,8 @@ elseif (DARWIN)
   # executable. This SHOULD properly be "$<TARGET_FILE_DIR:lltest>/Resources",
   # but the CMake $<TARGET_FILE_DIR> generator expression isn't evaluated by
   # CREATE_LINK, so fudge it.
+  # Make sure the symlink's parent directory exists...
+  file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test")
   file(CREATE_LINK "../sharedlibs/Release/Resources" "${CMAKE_BINARY_DIR}/test/Resources"
        SYMBOLIC)
 endif (WINDOWS)
-- 
GitLab