diff options
author | Alexander Grund <git@grundis.de> | 2018-12-16 17:05:23 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-01-04 22:09:39 (GMT) |
commit | 08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce (patch) | |
tree | 78cb35917baeebf19f4521152c1dc66ab3451e9d /Modules/GetPrerequisites.cmake | |
parent | 52445300d67df73b5b8c288cc33c915053c7ba24 (diff) | |
download | CMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.zip CMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.tar.gz CMake-08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce.tar.bz2 |
GetPrerequisites: Fix handling of executable scripts
Fixes: #18667
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index d3b773c..fa6d75a 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -660,6 +660,15 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa return() endif() + # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang) + file(READ ${target} file_contents LIMIT 5) + if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES "^#!") + message(STATUS "GetPrequisites(${target}) : ignoring script file") + # Clear var + set(${prerequisites_var} "" PARENT_SCOPE) + return() + endif() + set(gp_cmd_paths ${gp_cmd_paths} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin" "$ENV{VS140COMNTOOLS}/../../VC/bin" |