Mateusz Loskot wrote:
> Hi,
>
> Here is a tiny patch that tidies up BoostUtils.cmake to make
> its style more consistent.
I forgot to unify name of parse_arguments macro, thus
here is the update.
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
diff --git a/tools/build/CMake/BoostUtils.cmake b/tools/build/CMake/BoostUtils.cmake
index 8cf2632..f796f28 100644
--- a/tools/build/CMake/BoostUtils.cmake
+++ b/tools/build/CMake/BoostUtils.cmake
@@ -51,57 +51,57 @@ macro(cdr var junk)
set(${var} ${ARGN})
endmacro(cdr)
-# The PARSE_ARGUMENTS macro will take the arguments of another macro and
-# define several variables. The first argument to PARSE_ARGUMENTS is a
+# The parse_arguments macro will take the arguments of another macro and
+# define several variables. The first argument to parse_arguments is a
# prefix to put on all variables it creates. The second argument is a
# list of names, and the third argument is a list of options. Both of
-# these lists should be quoted. The rest of PARSE_ARGUMENTS are
+# these lists should be quoted. The rest of parse_arguments are
# arguments from another macro to be parsed.
#
-# PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
+# parse_arguments(prefix arg_names options arg1 arg2...)
#
-# For each item in options, PARSE_ARGUMENTS will create a variable with
+# For each item in options, parse_arguments will create a variable with
# that name, prefixed with prefix_. So, for example, if prefix is
-# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will
+# MY_MACRO and options is OPTION1;OPTION2, then parse_arguments will
# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These
# variables will be set to true if the option exists in the command line
# or false otherwise.
#
-# For each item in arg_names, PARSE_ARGUMENTS will create a variable
+# For each item in arg_names, parse_arguments will create a variable
# with that name, prefixed with prefix_. Each variable will be filled
# with the arguments that occur after the given arg_name is encountered
# up to the next arg_name or the end of the arguments. All options are
-# removed from these lists. PARSE_ARGUMENTS also creates a
+# removed from these lists. parse_arguments also creates a
# prefix_DEFAULT_ARGS variable containing the list of all arguments up
# to the first arg_name encountered.
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
- SET(DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- LIST_CONTAINS(is_arg_name ${arg} ${arg_names})
- IF (is_arg_name)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name)
- LIST_CONTAINS(is_option ${arg} ${option_names})
- IF (is_option)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option)
- ENDIF (is_arg_name)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
+macro(parse_arguments prefix arg_names option_names)
+ set(DEFAULT_ARGS)
+ foreach(arg_name ${arg_names})
+ set(${prefix}_${arg_name})
+ endforeach(arg_name)
+ foreach(option ${option_names})
+ set(${prefix}_${option} FALSE)
+ endforeach(option)
+
+ set(current_arg_name DEFAULT_ARGS)
+ set(current_arg_list)
+ foreach(arg ${ARGN})
+ list_contains(is_arg_name ${arg} ${arg_names})
+ if (is_arg_name)
+ set(${prefix}_${current_arg_name} ${current_arg_list})
+ set(current_arg_name ${arg})
+ set(current_arg_list)
+ else (is_arg_name)
+ list_contains(is_option ${arg} ${option_names})
+ if (is_option)
+ set(${prefix}_${arg} TRUE)
+ else (is_option)
+ set(current_arg_list ${current_arg_list} ${arg})
+ endif (is_option)
+ endif (is_arg_name)
+ endforeach(arg)
+ set(${prefix}_${current_arg_name} ${current_arg_list})
+endmacro(parse_arguments)
# Perform a reverse topological sort on the given LIST.
#
@@ -246,22 +246,21 @@ function (colormsg)
set(LO${color} "2\;${${color}}")
set(_${color}_ "4\;${${color}}")
set(_HI${color}_ "1\;4\;${${color}}")
- set(_LO${color}_ "2\;4\;${${color}}")
- endforeach()
+ set(_LO${color}_ "2\;4\;${${color}}") endforeach()
set(str "")
set(coloron FALSE)
foreach(arg ${ARGV})
if (NOT ${${arg}} STREQUAL "")
if (CMAKE_COLOR_MAKEFILE)
- set(str "${str}${_escape}[${${arg}}m")
- set(coloron TRUE)
+ set(str "${str}${_escape}[${${arg}}m")
+ set(coloron TRUE)
endif()
else()
set(str "${str}${arg}")
if (coloron)
- set(str "${str}${_escape}[0m")
- set(coloron FALSE)
+ set(str "${str}${_escape}[0m")
+ set(coloron FALSE)
endif()
set(str "${str} ")
endif()
_______________________________________________
Boost-cmake mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/boost-cmake