diff options
author | Gautier Pelloux-Prayer <gautier+git@damsy.net> | 2017-02-27 16:15:49 (GMT) |
---|---|---|
committer | Gautier Pelloux-Prayer <gautier+git@damsy.net> | 2017-02-28 09:45:25 (GMT) |
commit | 8d71fa92838f9fd3d444963c6ea6ea0d7be39cf3 (patch) | |
tree | e75bad4d9ef1525d6f8c7c4ddb4ba01091a3558c /Modules/FindPkgConfig.cmake | |
parent | cdb6d7df970fcaaf6cda1bef9955351222e1bcde (diff) | |
download | CMake-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 'Modules/FindPkgConfig.cmake')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 35 |
1 files changed, 11 insertions, 24 deletions
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( |