summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
diff options
context:
space:
mode:
authorAlexander Grund <git@grundis.de>2018-12-16 17:05:23 (GMT)
committerCraig Scott <craig.scott@crascit.com>2019-01-04 22:09:39 (GMT)
commit08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce (patch)
tree78cb35917baeebf19f4521152c1dc66ab3451e9d /Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
parent52445300d67df73b5b8c288cc33c915053c7ba24 (diff)
downloadCMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.zip
CMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.tar.gz
CMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.tar.bz2
GetPrerequisites: Fix handling of executable scripts
Fixes: #18667
Diffstat (limited to 'Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake')
-rw-r--r--Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
new file mode 100644
index 0000000..d1bc9b1
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
@@ -0,0 +1,19 @@
+include(GetPrerequisites)
+
+function(check_script script)
+ set(prereqs "")
+ get_prerequisites(${script} prereqs 1 1 "" "")
+ if(NOT "${prereqs}" STREQUAL "")
+ message(FATAL_ERROR "Prerequisites for ${script} not empty")
+ endif()
+endfunction()
+
+# Should not throw any errors
+# Regular executable
+get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "")
+# Shell script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
+# Batch script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
+# Shell script without extension
+check_script(${CMAKE_CURRENT_LIST_DIR}/script)