summaryrefslogtreecommitdiffstats
path: root/Modules/FindPackageHandleStandardArgs.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-11-29 08:21:18 (GMT)
committerAlex Neundorf <neundorf@kde.org>2012-11-29 08:21:18 (GMT)
commit4809cadfe82316b648de50471169b4da9ef101e2 (patch)
tree00b101cf01d48f498858f97ef97b5d17f7d7d0a4 /Modules/FindPackageHandleStandardArgs.cmake
parentd5ac791366595be307896e9894c66815c1e1eb2f (diff)
downloadCMake-4809cadfe82316b648de50471169b4da9ef101e2.zip
CMake-4809cadfe82316b648de50471169b4da9ef101e2.tar.gz
CMake-4809cadfe82316b648de50471169b4da9ef101e2.tar.bz2
FPHSA: don't succeed if only checking for XX_FOUND (#13755)
This fixes issue #13755. FPHSA(XX DEFAULT_MSG XX_FOUND) always succeeded due to the way how the XX_FOUND variable was set. It was preset to TRUE, and then reset to FALSE if something was missing (...which had the effect that XX_FOUND itself was already preset when FPHSA checked whether XX_FOUND is set) Now XX_FOUND is unset first, and only later on set to TRUE. Alex
Diffstat (limited to 'Modules/FindPackageHandleStandardArgs.cmake')
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 5549d14..e89e9a9 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -187,8 +187,8 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
- set(${_NAME_UPPER}_FOUND TRUE)
# check if all passed variables are valid
+ unset(${_NAME_UPPER}_FOUND)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(${_NAME_UPPER}_FOUND FALSE)
@@ -197,6 +197,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
endif()
endforeach()
+ if(NOT "${${_NAME_UPPER}_FOUND}" STREQUAL "FALSE")
+ set(${_NAME_UPPER}_FOUND TRUE)
+ endif()
# component handling
unset(FOUND_COMPONENTS_MSG)