summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
blob: abe14bf98ab44684a756ed0234d9d8ea983a0ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# This is a replacement for pkg-config that compares the string passed
# to the --exists argument with the PKG_CONFIG_PATH environment variable
# and returns 1 if they are different.

case $1 in
  --version)
    echo "0.0-cmake-dummy"
    ;;
  --exists)
    shift
    eval last=\${$#}
    echo "Expected: ${last}"
    echo "Found:    ${PKG_CONFIG_PATH}"
    [ "${last}" = "${PKG_CONFIG_PATH}" ] || exit 1
    ;;
  *)
    exit 255
    ;;
esac