From 10dfc89731f1a4152d7a0e2c728affce0948a585 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Wed, 6 Feb 2008 17:02:53 -0500 Subject: STYLE: use a function instead of a macro, to keep FAIL_MESSAGE local patch from Miguel Alex --- Modules/FindPackageHandleStandardArgs.cmake | 8 ++++++-- 1 file 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) -- cgit v0.12