diff options
author | Benjamin Chrétien <chretien@lirmm.fr> | 2015-10-27 04:21:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-10-28 14:18:15 (GMT) |
commit | 1bfb527f561c705169f0716108e34a2b5ba5c8bb (patch) | |
tree | 1a63cbf0aba48a4ae1c59a83ec2b21e11b704095 /Tests/RunCMake/FindPkgConfig | |
parent | 2fd5fd1f4d93322e85d662c1467a46cd7da84560 (diff) | |
download | CMake-1bfb527f561c705169f0716108e34a2b5ba5c8bb.zip CMake-1bfb527f561c705169f0716108e34a2b5ba5c8bb.tar.gz CMake-1bfb527f561c705169f0716108e34a2b5ba5c8bb.tar.bz2 |
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/RunCMake/FindPkgConfig')
-rwxr-xr-x | Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh | 5 |
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 852e841..abe14bf 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 |