summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-10-07 20:46:11 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2014-10-07 21:14:46 (GMT)
commitba907f7dc21163df29872a221dfeae18379319c6 (patch)
tree6c37e933157d3112107f2b2887c57973dc669588 /Modules
parent4f9bf4468bd5bcd48be080fa0bc736ebb9df4769 (diff)
downloadCMake-ba907f7dc21163df29872a221dfeae18379319c6.zip
CMake-ba907f7dc21163df29872a221dfeae18379319c6.tar.gz
CMake-ba907f7dc21163df29872a221dfeae18379319c6.tar.bz2
FPHSA: fix when requested or found version is exactly 0
Until now it was checked with "if(VAR)", which will be false in case "0" is the content of the variable.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index f6e536b..23f3f05 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -284,10 +284,11 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
- set(VERSION ${${FPHSA_VERSION_VAR}} )
- if (${_NAME}_FIND_VERSION)
+ set(VERSION ${${FPHSA_VERSION_VAR}})
- if(VERSION)
+ # check with DEFINED here as the requested or found version may be "0"
+ if (DEFINED ${_NAME}_FIND_VERSION)
+ if(DEFINED ${FPHSA_VERSION_VAR})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
# count the dots in the version string