diff options
author | Andreas Pakulat <apaku@gmx.de> | 2010-05-05 18:47:06 +0000 |
---|---|---|
committer | Andreas Pakulat <apaku@gmx.de> | 2010-05-05 18:47:06 +0000 |
commit | 121cf2babaa736e4110d30b28e41d6c199841aaf (patch) | |
tree | 9c8b573215770ae846109021f05338ce7549d5c1 | |
parent | 453117bee52af37ad1433a318a69fb6718f1465f (diff) | |
download | extra-cmake-modules-121cf2babaa736e4110d30b28e41d6c199841aaf.tar.gz extra-cmake-modules-121cf2babaa736e4110d30b28e41d6c199841aaf.tar.bz2 |
Fix FindPackageHandleStandardArgs.cmake for cmake's config-mode.
When using the Config-Mode with a -version-file then cmake automatically sets
the <module>_VERSION variable, but it uses the mixed-case that is used as
module name.
The logic in this file so far however always expected the version variable to be
all upper-case breaking the logic when using it in a simplified FindXxx.cmake module.
This happened to kdevplatform/kdevelop.
svn path=/trunk/KDE/kdelibs/; revision=1123271
-rw-r--r-- | modules/FindPackageHandleStandardArgs.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/FindPackageHandleStandardArgs.cmake b/modules/FindPackageHandleStandardArgs.cmake index 8e99e88b..fe4345c7 100644 --- a/modules/FindPackageHandleStandardArgs.cmake +++ b/modules/FindPackageHandleStandardArgs.cmake @@ -73,7 +73,11 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) # if the package was found, check for the version using <NAME>_FIND_VERSION IF (${_NAME_UPPER}_FOUND) - SET(VERSION ${${_NAME_UPPER}_VERSION}) + IF(${_NAME_UPPER}_VERSION) + SET(VERSION ${${_NAME_UPPER}_VERSION}) + ELSEIF(${_NAME}_VERSION) + SET(VERSION ${${_NAME}_VERSION}) + ENDIF(${_NAME_UPPER}_VERSION) IF(VERSION) #hmm what do we do if the module in question doesn't set FOO_VERSION but something else ?... Ignore it for now |