[cmake-commits] alex committed FindPackageHandleStandardArgs.cmake
1.3 1.4
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Feb 6 17:02:55 EST 2008
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv22246
Modified Files:
FindPackageHandleStandardArgs.cmake
Log Message:
STYLE: use a function instead of a macro, to keep FAIL_MESSAGE local
patch from Miguel
Alex
Index: FindPackageHandleStandardArgs.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindPackageHandleStandardArgs.cmake,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- FindPackageHandleStandardArgs.cmake 7 Aug 2007 02:08:59 -0000 1.3
+++ FindPackageHandleStandardArgs.cmake 6 Feb 2008 22:02:53 -0000 1.4
@@ -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 @@
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 @@
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)
More information about the Cmake-commits
mailing list