[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-641-g126c84a
Brad King
brad.king at kitware.com
Tue Feb 28 11:10:53 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 126c84a4bb4122c67839f60dba1a0877ff0234c0 (commit)
via 8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3 (commit)
from f9ea9e5b5716a3b37799af673375bb41d5cb5816 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=126c84a4bb4122c67839f60dba1a0877ff0234c0
commit 126c84a4bb4122c67839f60dba1a0877ff0234c0
Merge: f9ea9e5 8d71fa9
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 28 11:10:52 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 28 11:10:52 2017 -0500
Merge topic 'FindPkgConfig-version-ops' into next
8d71fa92 FindPkgConfig: use new version checking "library >= version" syntax
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3
commit 8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3
Author: Gautier Pelloux-Prayer <gautier+git at damsy.net>
AuthorDate: Mon Feb 27 17:15:49 2017 +0100
Commit: Gautier Pelloux-Prayer <gautier+git at damsy.net>
CommitDate: Tue Feb 28 10:45:25 2017 +0100
FindPkgConfig: use new version checking "library >= version" syntax
Instead of the deprecated --atleast-version one.
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 1958f4b..a69081f 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -360,38 +360,25 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
set(_pkg_check_modules_pkg_ver)
endif()
- # handle the operands
- if (_pkg_check_modules_pkg_op STREQUAL ">=")
- list(APPEND _pkg_check_modules_exist_query --atleast-version)
- endif()
-
- if (_pkg_check_modules_pkg_op STREQUAL "=")
- list(APPEND _pkg_check_modules_exist_query --exact-version)
- endif()
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
- if (_pkg_check_modules_pkg_op STREQUAL "<=")
- list(APPEND _pkg_check_modules_exist_query --max-version)
- endif()
+ list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}")
# create the final query which is of the format:
- # * --atleast-version <version> <pkg-name>
- # * --exact-version <version> <pkg-name>
- # * --max-version <version> <pkg-name>
+ # * <pkg-name> >= <version>
+ # * <pkg-name> = <version>
+ # * <pkg-name> <= <version>
# * --exists <pkg-name>
+ list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors)
if (_pkg_check_modules_pkg_op)
- list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
+ list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name} ${_pkg_check_modules_pkg_op} ${_pkg_check_modules_pkg_ver}")
else()
list(APPEND _pkg_check_modules_exist_query --exists)
+ list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
endif()
- list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors)
-
- _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
- _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
- _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
- _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
-
- list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
- list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}")
# execute the query
execute_process(
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
-----------------------------------------------------------------------
Summary of changes:
Modules/FindPkgConfig.cmake | 35 +++++++--------------
Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat | 11 ++++++-
Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh | 32 ++++++++++---------
3 files changed, 38 insertions(+), 40 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list