diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2018-10-02 20:36:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-04 14:32:13 (GMT) |
commit | aa51bfd74f906b5447b6243aac7e0dec08d5bc6d (patch) | |
tree | b3c30ff37034ce7fb6b613cb303cec44608a4bd5 /Modules/FindPkgConfig.cmake | |
parent | fd02538974dd952a8639d371c2c0067d30d5469a (diff) | |
download | CMake-aa51bfd74f906b5447b6243aac7e0dec08d5bc6d.zip CMake-aa51bfd74f906b5447b6243aac7e0dec08d5bc6d.tar.gz CMake-aa51bfd74f906b5447b6243aac7e0dec08d5bc6d.tar.bz2 |
FindPkgConfig: support also > and < operators for version compares
Fixes: #18416
Diffstat (limited to 'Modules/FindPkgConfig.cmake')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 3934867..a96df99 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -397,7 +397,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma set(_pkg_check_modules_exist_query) # check whether version is given - if (_pkg_check_modules_pkg MATCHES "(.*[^><])(>=|=|<=)(.*)") + if (_pkg_check_modules_pkg MATCHES "(.*[^><])(=|[><]=?)(.*)") set(_pkg_check_modules_pkg_name "${CMAKE_MATCH_1}") set(_pkg_check_modules_pkg_op "${CMAKE_MATCH_2}") set(_pkg_check_modules_pkg_ver "${CMAKE_MATCH_3}") @@ -415,9 +415,11 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}") # create the final query which is of the format: + # * <pkg-name> > <version> # * <pkg-name> >= <version> # * <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) |