summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorGautier Pelloux-Prayer <gautier+git@damsy.net>2017-02-27 16:15:49 (GMT)
committerGautier Pelloux-Prayer <gautier+git@damsy.net>2017-02-28 09:45:25 (GMT)
commit8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3 (patch)
treee75bad4d9ef1525d6f8c7c4ddb4ba01091a3558c /Tests
parentcdb6d7df970fcaaf6cda1bef9955351222e1bcde (diff)
downloadCMake-8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3.zip
CMake-8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3.tar.gz
CMake-8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3.tar.bz2
FindPkgConfig: use new version checking "library >= version" syntax
Instead of the deprecated --atleast-version one.
Diffstat (limited to 'Tests')
-rwxr-xr-xTests/RunCMake/FindPkgConfig/dummy-pkg-config.bat11
-rwxr-xr-xTests/RunCMake/FindPkgConfig/dummy-pkg-config.sh32
2 files changed, 27 insertions, 16 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat
index f2f86b0..b038370 100755
--- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat
+++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat
@@ -1,7 +1,11 @@
@ECHO OFF
+
+:LOOP
+
IF "%1"=="" (
EXIT /B 255
)
+
IF "%1"=="--version" (
ECHO 0.0-cmake-dummy
EXIT /B 0
@@ -13,6 +17,11 @@ IF "%1"=="--exists" (
ECHO Found: %PKG_CONFIG_PATH%
IF NOT "%*"=="%PKG_CONFIG_PATH%" (
EXIT /B 1
+ ) ELSE (
+ EXIT /B 0
)
)
-EXIT /B 0
+SHIFT
+IF NOT "%~1"=="" GOTO LOOP
+
+EXIT /B 255
diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
index abe14bf..56bba30 100755
--- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
+++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh
@@ -4,18 +4,20 @@
# 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
+while [ $# -gt 0 ]; do
+ case $1 in
+ --version)
+ echo "0.0-cmake-dummy"
+ exit 0
+ ;;
+ --exists)
+ shift
+ eval last=\${$#}
+ echo "Expected: ${last}"
+ echo "Found: ${PKG_CONFIG_PATH}"
+ [ "${last}" = "${PKG_CONFIG_PATH}" ] && exit 0 || exit 1
+ ;;
+ esac
+ shift
+done
+exit 255