diff options
author | Brad King <brad.king@kitware.com> | 2020-06-15 12:57:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-15 12:58:06 (GMT) |
commit | 05546d695e2d98e420009bec2ce62253dffa3c60 (patch) | |
tree | 3a1d12784f81e94783653c4060721c8c8de9d9a8 /Tests/RunCMake | |
parent | 594fda9c234915669dbfe61bec7c59250e747b4a (diff) | |
parent | cc02ced530a40f98c7bf643cd91e4b811a0e3f7a (diff) | |
download | CMake-05546d695e2d98e420009bec2ce62253dffa3c60.zip CMake-05546d695e2d98e420009bec2ce62253dffa3c60.tar.gz CMake-05546d695e2d98e420009bec2ce62253dffa3c60.tar.bz2 |
Merge topic 'revert-find_program-exe-no-read' into release-3.18
cc02ced530 find_program: Revert "Find programs that are executable but not readable"
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4871
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/find_program/ExeNoRead-stdout.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/find_program/RunCMakeTest.cmake | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt index 35a83f2..f231178 100644 --- a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt +++ b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt @@ -1 +1 @@ --- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/ExeNoRead-build/ExeNoRead' +-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 95ffd84..2bb777b 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -9,8 +9,14 @@ run_cmake(Required) if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$") run_cmake(WindowsCom) run_cmake(WindowsExe) -endif() +else() + # test non readable file only if not root + execute_process( + COMMAND id -u $ENV{USER} + OUTPUT_VARIABLE uid + OUTPUT_STRIP_TRAILING_WHITESPACE) -if(UNIX) - run_cmake(ExeNoRead) + if(NOT "${uid}" STREQUAL "0") + run_cmake(ExeNoRead) + endif() endif() |