summaryrefslogtreecommitdiffstats
path: root/Modules/FindPackageHandleStandardArgs.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-02-06 22:02:53 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-02-06 22:02:53 (GMT)
commit10dfc89731f1a4152d7a0e2c728affce0948a585 (patch)
tree990af3638b314b3e5201369506616c9206eda8cc /Modules/FindPackageHandleStandardArgs.cmake
parentd9b97201670de2867483858794ba80b52cea1d66 (diff)
downloadCMake-10dfc89731f1a4152d7a0e2c728affce0948a585.zip
CMake-10dfc89731f1a4152d7a0e2c728affce0948a585.tar.gz
CMake-10dfc89731f1a4152d7a0e2c728affce0948a585.tar.bz2
STYLE: use a function instead of a macro, to keep FAIL_MESSAGE local
patch from Miguel Alex
Diffstat (limited to 'Modules/FindPackageHandleStandardArgs.cmake')
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 8d683cb3d..20d830c 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -17,7 +17,7 @@
# be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there.
-MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
@@ -32,6 +32,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
SET(${_NAME_UPPER}_FOUND FALSE)
ENDIF(NOT ${_VAR1})
+ # check if all passed variables are valid
FOREACH(_CURRENT_VAR ${ARGN})
IF(NOT ${_CURRENT_VAR})
SET(${_NAME_UPPER}_FOUND FALSE)
@@ -51,4 +52,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
ENDIF (NOT ${_NAME}_FIND_QUIETLY)
ENDIF (${_NAME}_FIND_REQUIRED)
ENDIF (${_NAME_UPPER}_FOUND)
-ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+
+ SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
+
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS)