Skip to content

Commit 6d663c5

Browse files
committed
Ensure binaries run through install_name_tool are user-writable during bundling on Mac
1 parent 00c8196 commit 6d663c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/MacBundleMacros.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ ENDFUNCTION (GET_INSTALL_NAME)
5050

5151
FUNCTION (INSTALLNAMETOOL_CHANGE CHANGE CHANGETO CHANGEBIN)
5252
IF (EXISTS "${CHANGEBIN}" AND CHANGE AND CHANGETO)
53+
# ensure CHANGEBIN is writable by user, e.g. Homebrew binaries are installed non-writable
54+
EXECUTE_PROCESS (COMMAND chmod u+w "${CHANGEBIN}")
5355
EXECUTE_PROCESS (COMMAND install_name_tool -change ${CHANGE} ${CHANGETO} "${CHANGEBIN}")
5456
ENDIF ()
5557
ENDFUNCTION (INSTALLNAMETOOL_CHANGE)
@@ -76,6 +78,8 @@ FUNCTION (COPY_FRAMEWORK FWPREFIX FWNAME FWDEST)
7678
EXECUTE_PROCESS (COMMAND cp -Rfp "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources" "${FWDEST}/${FWNAME}.framework/Versions/${FWVER}")
7779
EXECUTE_PROCESS (COMMAND ln -sfh Versions/Current/Resources "${FWDEST}/${FWNAME}.framework/Resources")
7880
ENDIF (IS_DIRECTORY "${FWPREFIX}/${FWNAME}.framework/Versions/${FWVER}/Resources")
81+
# ensure writable by user, e.g. Homebrew frameworks are installed non-writable
82+
EXECUTE_PROCESS (COMMAND chmod -R u+w "${FWDEST}/${FWNAME}.framework")
7983
EXECUTE_PROCESS (COMMAND install_name_tool -id "${ATEXECUTABLE}/${QGIS_FW_SUBDIR}/${FWNAME}" "${FWDEST}/${FWNAME}.framework/${FWNAME}")
8084
# debug variants
8185
SET (FWD "${FWNAME}_debug")

0 commit comments

Comments
 (0)