[cmake-developers] Weird behaviour of arguments in macro

Brad King brad.king at kitware.com
Mon Nov 18 12:44:02 EST 2013


On 11/18/2013 08:41 AM, Daniele E. Domenichelli wrote:
> Done, see topic macro-args-docs.

Good start.

Please place the "::" starting a literal block at the end of
the previous paragraph when the block is "part" of the paragraph.
For example:

+Therefore you will NOT be able to use commands like:
+
+::
+
+  if(ARGV1) # ARGV1 is not a variable

can be just.

+Therefore you will NOT be able to use commands like::
+
+  if(ARGV1) # ARGV1 is not a variable

The only reason so much of the documentation uses dedicated "::"
lines right now is because that was easiest for the automatic
converter to generate.

Also please use ``inline-code-example`` syntax for text referring
to constructs from the literal blocks.  For example:

+In the first case you can use if(${ARGV1}), in the second case, you can
+use foreach(loop_var ${ARGN}) but this will skip empty arguments.

should be something like

+In the first case you can use ``if(${ARGV1})``, in the second case,
+you can use ``foreach(loop_var ${ARGN})`` but this will skip empty
+arguments.

Let's call more attention to these caveats by taking the text starting
in "Note that the parameters to a macro" and making it its own
subsection under a heading such as

Macro Argument Caveats
^^^^^^^^^^^^^^^^^^^^^^

Thanks,
-Brad



More information about the cmake-developers mailing list