Skip to content

Commit

Permalink
Use stat -f for MacOSX (trilinos/Trilinos#7881)
Browse files Browse the repository at this point in the history
I have not been able to test that installation with this group and/or perms
modification code works on MacOSX but it was reported in
trilinos/Trilinos#7881 that calling 'stat -f %U <file>' works correctly.  (I
hope to be able to test this later as part of general MacOSX testing for
TriBITS.)
  • Loading branch information
bartlettroscoe committed Sep 16, 2020
1 parent cae55bc commit afb7f2e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ ENDFUNCTION()

FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

EXECUTE_PROCESS(COMMAND stat -c %U "${dirPath}"
IF (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(STAT_ARG "-f") # MacOSX stat
ELSE()
SET(STAT_ARG "-c") # BinUtils stat
ENDIF()

EXECUTE_PROCESS(COMMAND stat ${STAT_ARG} %U "${dirPath}"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE dirOwner)

Expand Down

0 comments on commit afb7f2e

Please sign in to comment.