summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-10 13:48:15 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-04-10 13:49:50 (GMT)
commitbf120819c4054def9dfb1433dc4d33971b92edd7 (patch)
tree7f1bc84267f3525834d855bad48b0cee4cfede6f /Tests
parent9ef0f35670c2f308b562b7042abb90fd0ae59160 (diff)
parent86e6349ef7356866704ab2a5aa439fd4d201cdd5 (diff)
downloadCMake-bf120819c4054def9dfb1433dc4d33971b92edd7.zip
CMake-bf120819c4054def9dfb1433dc4d33971b92edd7.tar.gz
CMake-bf120819c4054def9dfb1433dc4d33971b92edd7.tar.bz2
Merge topic 'find_program-exe-no-read'
86e6349ef7 find_program: Find programs that are executable but not readable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4571
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/find_program/ExeNoRead-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/ExeNoRead.cmake4
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake4
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
new file mode 100644
index 0000000..35a83f2
--- /dev/null
+++ b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
@@ -0,0 +1 @@
+-- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/ExeNoRead-build/ExeNoRead'
diff --git a/Tests/RunCMake/find_program/ExeNoRead.cmake b/Tests/RunCMake/find_program/ExeNoRead.cmake
new file mode 100644
index 0000000..7e22dc5
--- /dev/null
+++ b/Tests/RunCMake/find_program/ExeNoRead.cmake
@@ -0,0 +1,4 @@
+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}'")
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 0ff9a97..95ffd84 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -10,3 +10,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
run_cmake(WindowsCom)
run_cmake(WindowsExe)
endif()
+
+if(UNIX)
+ run_cmake(ExeNoRead)
+endif()