diff options
author | Brad King <brad.king@kitware.com> | 2018-10-04 14:36:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-10-04 14:36:49 (GMT) |
commit | cf57c27150ece9c0c8722021eb2ba38eea94c9bf (patch) | |
tree | d510431f5daf69dc41f4f45fecd729d984ebd204 /Modules | |
parent | bfc6a945915aa4b2296939e122d747a53701be42 (diff) | |
parent | aa51bfd74f906b5447b6243aac7e0dec08d5bc6d (diff) | |
download | CMake-cf57c27150ece9c0c8722021eb2ba38eea94c9bf.zip CMake-cf57c27150ece9c0c8722021eb2ba38eea94c9bf.tar.gz CMake-cf57c27150ece9c0c8722021eb2ba38eea94c9bf.tar.bz2 |
Merge topic 'pkgc-op-lt-gt'
aa51bfd74f FindPkgConfig: support also > and < operators for version compares
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2435
Diffstat (limited to 'Modules')
-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) |