summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBenjamin Chrétien <chretien@lirmm.fr>2015-10-27 13:21:50 +0900
committerBrad King <brad.king@kitware.com>2015-10-28 10:18:15 -0400
commit1bfb527f561c705169f0716108e34a2b5ba5c8bb (patch)
tree1a63cbf0aba48a4ae1c59a83ec2b21e11b704095 /Tests
parent2fd5fd1f4d93322e85d662c1467a46cd7da84560 (diff)
downloadcmake-1bfb527f561c705169f0716108e34a2b5ba5c8bb.tar.gz
FindPkgConfig: return actual error when a package is not found (#15810)
In some cases, CMake returned the following error: -- Checking for module 'foo' -- Package 'foo' not found When the actual error returned by pkg-config was: Package 'bar', required by 'foo', not found Now, the actual error is forwarded to the user. -- Checking for module 'foo' -- Package 'bar', required by 'foo', not found For the standard case (i.e. the package was indeed not found), the CMake error was: -- Checking for module 'foo' -- Package 'foo' not found But it now prints: -- Checking for module 'foo' -- No package 'foo' found The associated test was also updated. ${last} refers to the last CLI argument.
Diffstat (limited to 'Tests')
-rwxr-xr-xTests/RunCMake/FindPkgConfig/dummy-pkg-config.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
index 852e841ad6..abe14bf98a 100755
--- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
+++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
@@ -10,9 +10,10 @@ case $1 in
;;
--exists)
shift
- echo "Expected: $@"
+ eval last=\${$#}
+ echo "Expected: ${last}"
echo "Found: ${PKG_CONFIG_PATH}"
- [ "$@" = "${PKG_CONFIG_PATH}" ] || exit 1
+ [ "${last}" = "${PKG_CONFIG_PATH}" ] || exit 1
;;
*)
exit 255