diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-09-30 12:22:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-30 12:22:49 (GMT) |
commit | f002c1cfc7f66edb9c9821524671574c23f92cd2 (patch) | |
tree | 35244a9e4a630d12df182842b66a5daa536b0ca7 /Modules | |
parent | 1c3244ca30d3139c61f7c8d99481d5c00295e97c (diff) | |
parent | 212b0afb66d293bb88261710a3365f95b8104898 (diff) | |
download | CMake-f002c1cfc7f66edb9c9821524671574c23f92cd2.zip CMake-f002c1cfc7f66edb9c9821524671574c23f92cd2.tar.gz CMake-f002c1cfc7f66edb9c9821524671574c23f92cd2.tar.bz2 |
Merge topic 'find-package-check-empty-version-range'
212b0afb66 find_package: raise error on empty version range
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5294
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPackageHandleStandardArgs.cmake | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index b06433d..7af0171 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -294,16 +294,12 @@ function(FIND_PACKAGE_CHECK_VERSION version result) unset (version_msg) if (FPCV_HANDLE_VERSION_RANGE AND ${package}_FIND_VERSION_RANGE) - if (${package}_FIND_VERSION_MIN VERSION_GREATER ${package}_FIND_VERSION_MAX - OR (${package}_FIND_VERSION_MIN VERSION_EQUAL ${package}_FIND_VERSION_MAX - AND ${package}_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE")) - set (version_msg "Found unsuitable version \"${version}\", required range is empty (\"${${package}_FIND_VERSION_RANGE}\")") - elseif ((${package}_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" - AND version VERSION_GREATER_EQUAL ${package}_FIND_VERSION_MIN) + if ((${package}_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" + AND version VERSION_GREATER_EQUAL ${package}_FIND_VERSION_MIN) AND ((${package}_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND version VERSION_LESS_EQUAL ${package}_FIND_VERSION_MAX) OR (${package}_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" - AND version VERSION_LESS ${package}_FIND_VERSION_MAX))) + AND version VERSION_LESS ${package}_FIND_VERSION_MAX))) set (version_ok TRUE) set(version_msg "(found suitable version \"${version}\", required range is \"${${package}_FIND_VERSION_RANGE}\")") else() |