Commit 10dfc897 authored by Alexander Neundorf's avatar Alexander Neundorf
Browse files

STYLE: use a function instead of a macro, to keep FAIL_MESSAGE local

patch from Miguel

Alex
parent d9b97201
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# be "Could NOT find LibXml2", if you don't like this message you can specify # be "Could NOT find LibXml2", if you don't like this message you can specify
# your own custom failure message there. # 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") IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
SET(_FAIL_MESSAGE "Could NOT find ${_NAME}") SET(_FAIL_MESSAGE "Could NOT find ${_NAME}")
...@@ -32,6 +32,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) ...@@ -32,6 +32,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
SET(${_NAME_UPPER}_FOUND FALSE) SET(${_NAME_UPPER}_FOUND FALSE)
ENDIF(NOT ${_VAR1}) ENDIF(NOT ${_VAR1})
# check if all passed variables are valid
FOREACH(_CURRENT_VAR ${ARGN}) FOREACH(_CURRENT_VAR ${ARGN})
IF(NOT ${_CURRENT_VAR}) IF(NOT ${_CURRENT_VAR})
SET(${_NAME_UPPER}_FOUND FALSE) SET(${_NAME_UPPER}_FOUND FALSE)
...@@ -51,4 +52,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) ...@@ -51,4 +52,7 @@ MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
ENDIF (NOT ${_NAME}_FIND_QUIETLY) ENDIF (NOT ${_NAME}_FIND_QUIETLY)
ENDIF (${_NAME}_FIND_REQUIRED) ENDIF (${_NAME}_FIND_REQUIRED)
ENDIF (${_NAME_UPPER}_FOUND) 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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment