Skip to content

SystemTools: Teach FindProgram to find non-readable programs

Vladimir requested to merge whoozle/kwsys:fix-find-program into master

This commit fixes FindProgram failing to detect executable without read bit set. find_program internally uses SystemTools::FileExists which calls access(R_OK) instead of access(X_OK). Replacing SystemTools::FileExists with SystemTools::TestFileAccess fixes this issue.

Fine example of such program is sudo.

Issue: cmake/cmake#10468 (closed)

Edited by Brad King

Merge request reports