Skip to content

Commit

Permalink
Fix permissions with CMake <= 3.16
Browse files Browse the repository at this point in the history
  • Loading branch information
daljit46 committed Jun 20, 2024
1 parent 1f1fb1d commit 4f55a08
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmake/MakePythonExecutable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ else()
endif()

file(WRITE ${OUTPUT_DIR}/${CMDNAME} ${BINPATH_CONTENTS})
file(CHMOD ${OUTPUT_DIR}/${CMDNAME} FILE_PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
file(CHMOD ${OUTPUT_DIR}/${CMDNAME} FILE_PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
else()
file(COPY ${OUTPUT_DIR}/${CMDNAME} DESTINATION ${OUTPUT_DIR} FILE_PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
endif()

0 comments on commit 4f55a08

Please sign in to comment.