mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
cc02ced530
The fix in commit 86e6349ef7 (find_program: Find programs that are
executable but not readable, 2020-04-04, v3.18.0-rc1~372^2) can break
existing projects that were (likely accidentally) relying on the
old behavior to find files that are readable but not executable.
Revert the fix for now. We can re-introduce it with a policy later.
Instead of reverting the test case, update it to cover the old behavior.
That can serve as a reference for testing the policy when introduced.
Fixes: #20814
Issue: #10468
23 lines
470 B
CMake
23 lines
470 B
CMake
include(RunCMake)
|
|
|
|
run_cmake(EnvAndHints)
|
|
run_cmake(DirsPerName)
|
|
run_cmake(NamesPerDir)
|
|
run_cmake(RelAndAbsPath)
|
|
run_cmake(Required)
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
|
|
run_cmake(WindowsCom)
|
|
run_cmake(WindowsExe)
|
|
else()
|
|
# test non readable file only if not root
|
|
execute_process(
|
|
COMMAND id -u $ENV{USER}
|
|
OUTPUT_VARIABLE uid
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if(NOT "${uid}" STREQUAL "0")
|
|
run_cmake(ExeNoRead)
|
|
endif()
|
|
endif()
|