diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-09-29 11:02:23 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-09-29 11:06:09 (GMT) |
commit | 212b0afb66d293bb88261710a3365f95b8104898 (patch) | |
tree | f41da17c590f760f171b068701970bda08ebc030 /Modules/FindPackageHandleStandardArgs.cmake | |
parent | 1382002ae2e78ea8bcda7f97be9130246ea40b11 (diff) | |
download | CMake-212b0afb66d293bb88261710a3365f95b8104898.zip CMake-212b0afb66d293bb88261710a3365f95b8104898.tar.gz CMake-212b0afb66d293bb88261710a3365f95b8104898.tar.bz2 |
find_package: raise error on empty version range
Diffstat (limited to 'Modules/FindPackageHandleStandardArgs.cmake')
-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() |