diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-01-06 20:05:18 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-06 20:05:32 (GMT) |
commit | 99a0a6d8163f27daf08e53da95b8c685bcd5189e (patch) | |
tree | ba1f00ba284d264975a9c45e41fcdff1164ea63b /Tests | |
parent | d3e0e65de3dc8fbc8b96ef9780bffe7390bf6b70 (diff) | |
parent | 08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce (diff) | |
download | CMake-99a0a6d8163f27daf08e53da95b8c685bcd5189e.zip CMake-99a0a6d8163f27daf08e53da95b8c685bcd5189e.tar.gz CMake-99a0a6d8163f27daf08e53da95b8c685bcd5189e.tar.bz2 |
Merge topic 'bundle_fixes'
08be74bfd7 GetPrerequisites: Fix handling of executable scripts
52445300d6 GetPrerequisites: Allow prefixed tools
1bac4678ea GetPrerequisites: Add GET_PREREQUISITES_VERBOSE to set verbose
5072598f07 BundleUtilites: Don't use hardcoded name for install_name_tool
428680da92 GetPrerequisites: Don't use hardcoded name for otool
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2748
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake | 19 | ||||
-rw-r--r-- | Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake | 1 | ||||
-rwxr-xr-x | Tests/RunCMake/GetPrerequisites/script | 3 | ||||
-rwxr-xr-x | Tests/RunCMake/GetPrerequisites/script.bat | 3 | ||||
-rwxr-xr-x | Tests/RunCMake/GetPrerequisites/script.sh | 3 |
6 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt new file mode 100644 index 0000000..5a353d8 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt @@ -0,0 +1,3 @@ +-- GetPrequisites\(.*script.sh\) : ignoring script file +-- GetPrequisites\(.*script.bat\) : ignoring script file +-- GetPrequisites\(.*script\) : ignoring script file 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) diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake index 3856c54..a635e38 100644 --- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake +++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake) +run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake) diff --git a/Tests/RunCMake/GetPrerequisites/script b/Tests/RunCMake/GetPrerequisites/script new file mode 100755 index 0000000..23bf47c --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello World" diff --git a/Tests/RunCMake/GetPrerequisites/script.bat b/Tests/RunCMake/GetPrerequisites/script.bat new file mode 100755 index 0000000..dbb0ec2 --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script.bat @@ -0,0 +1,3 @@ +@echo off + +echo "Hello world" diff --git a/Tests/RunCMake/GetPrerequisites/script.sh b/Tests/RunCMake/GetPrerequisites/script.sh new file mode 100755 index 0000000..23bf47c --- /dev/null +++ b/Tests/RunCMake/GetPrerequisites/script.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hello World" |