Skip to content
Snippets Groups Projects
Commit bf120819 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'find_program-exe-no-read'


86e6349e find_program: Find programs that are executable but not readable

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4571
parents 9ef0f356 86e6349e
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ struct cmFindProgramHelper
this->TestNameExt = cmStrCat(name, ext);
this->TestPath =
cmSystemTools::CollapseFullPath(this->TestNameExt, path);
bool exists = cmSystemTools::FileExists(this->TestPath, true);
bool exists = cmSystemTools::FileIsExecutable(this->TestPath);
exists ? this->DebugSearches.FoundAt(this->TestPath)
: this->DebugSearches.FailedAt(this->TestPath);
if (exists) {
......
-- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/ExeNoRead-build/ExeNoRead'
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead" "#!/bin/sh\n")
execute_process(COMMAND chmod -r+x "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead")
find_program(ExeNoRead_EXECUTABLE NAMES ExeNoRead NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}")
message(STATUS "ExeNoRead_EXECUTABLE='${ExeNoRead_EXECUTABLE}'")
......@@ -10,3 +10,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
run_cmake(WindowsCom)
run_cmake(WindowsExe)
endif()
if(UNIX)
run_cmake(ExeNoRead)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment