summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_program/testCWD
diff options
context:
space:
mode:
authorSam Yates <halfflat@gmail.com>2018-05-31 17:00:45 (GMT)
committerBrad King <brad.king@kitware.com>2018-06-14 18:28:03 (GMT)
commitc76c1ea2086a071c0afb143918b275bb8cf3b806 (patch)
tree7184a4caf92cbfe339d5e2233e5d30e12895dbe6 /Tests/RunCMake/find_program/testCWD
parent575f97763f08f0358cb5ccb4ac937d1610cbbbf7 (diff)
downloadCMake-c76c1ea2086a071c0afb143918b275bb8cf3b806.zip
CMake-c76c1ea2086a071c0afb143918b275bb8cf3b806.tar.gz
CMake-c76c1ea2086a071c0afb143918b275bb8cf3b806.tar.bz2
find_program: Consider CWD only for paths with separator
find_program() incorrectly prepended search path components to absolute file paths, and incorrectly searched the current working directory for files that contained no directory separators. * Replace calls cmFindProgramHelper::CheckDirectory(std::string()) with call of new method cmFindProgramHelper::CheckCompoundNames() that checks for the presence of a directory separator in the file name. * Use cmSystemTools::CollapseCombinedPath rather than string concatenation to properly combine absolute file names with search path components. * Add unit tests to verify corrections. Fixes: #18044
Diffstat (limited to 'Tests/RunCMake/find_program/testCWD')
-rwxr-xr-xTests/RunCMake/find_program/testCWD1
1 files changed, 1 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_program/testCWD b/Tests/RunCMake/find_program/testCWD
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/testCWD
@@ -0,0 +1 @@
+#!/bin/sh