Skip to content

Commit 2d13a50

Browse files
authored
Merge pull request #732 from openstudiocoalition/fix_cpack
Fix a race condition during CPack packaging when creating symlink on Apple
2 parents ced0efb + fef3b9c commit 2d13a50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/openstudio_app/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@ if( APPLE )
472472
"${CMAKE_INSTALL_PREFIX}/OpenStudioApp.app/Contents/Frameworks/$<TARGET_FILE_NAME:openstudio::openstudiolib>"
473473
474474
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_INSTALL_PREFIX}/bin"
475+
476+
COMMAND_ECHO STDOUT
477+
COMMAND_ERROR_IS_FATAL ANY
478+
)
479+
480+
# We break it into two `execute_process`es so that there is no race condition between the make_directory above and the create_symlink below
481+
execute_process(
475482
COMMAND "${CMAKE_COMMAND}" -E create_symlink
476483
"../OpenStudioApp.app/Contents/MacOS/$<TARGET_FILE_NAME:openstudio::openstudio>"
477484
"${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:openstudio::openstudio>"

0 commit comments

Comments
 (0)