summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake22
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 6de7dbf..56ba1e6 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -538,17 +538,21 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# check that the version variable is not empty to avoid emitting a misleading
# message (i.e. `Found unsuitable version ""`)
if (DEFINED ${_NAME}_FIND_VERSION)
- if(NOT "${${FPHSA_VERSION_VAR}}" STREQUAL "")
- set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
- if (FPHSA_HANDLE_VERSION_RANGE)
- set (FPCV_HANDLE_VERSION_RANGE HANDLE_VERSION_RANGE)
+ if(DEFINED ${FPHSA_VERSION_VAR})
+ if(NOT "${${FPHSA_VERSION_VAR}}" STREQUAL "")
+ set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
+ if (FPHSA_HANDLE_VERSION_RANGE)
+ set (FPCV_HANDLE_VERSION_RANGE HANDLE_VERSION_RANGE)
+ else()
+ set(FPCV_HANDLE_VERSION_RANGE NO_AUTHOR_WARNING_VERSION_RANGE)
+ endif()
+ find_package_check_version ("${_FOUND_VERSION}" VERSION_OK RESULT_MESSAGE_VARIABLE VERSION_MSG
+ ${FPCV_HANDLE_VERSION_RANGE})
else()
- set(FPCV_HANDLE_VERSION_RANGE NO_AUTHOR_WARNING_VERSION_RANGE)
+ set(VERSION_OK FALSE)
endif()
- find_package_check_version ("${_FOUND_VERSION}" VERSION_OK RESULT_MESSAGE_VARIABLE VERSION_MSG
- ${FPCV_HANDLE_VERSION_RANGE})
- else()
- set(VERSION_OK FALSE)
+ endif()
+ if("${${FPHSA_VERSION_VAR}}" STREQUAL "")
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")