Document opt_CMAKE_BOOL and opt_CMAKE_BOOL_OFF.
PR: 210576 Reviewed by: wblock Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D6970
This commit is contained in:
parent
0d7e65ffe0
commit
29687c5104
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=49014
1 changed files with 48 additions and 2 deletions
|
|
@ -4342,7 +4342,7 @@ CONFIGURE_ARGS+= --no-test
|
|||
<emphasis>not</emphasis> selected. For example:</para>
|
||||
|
||||
<programlisting>OPTIONS_DEFINE= OPT1
|
||||
OPT1_CMAKE_ON= -DTEST:BOOL=true
|
||||
OPT1_CMAKE_ON= -DTEST:BOOL=true -DDEBUG:BOOL=true
|
||||
OPT1_CMAKE_OFF= -DOPTIMIZE:BOOL=true</programlisting>
|
||||
|
||||
<para>is equivalent to:</para>
|
||||
|
|
@ -4352,9 +4352,55 @@ OPT1_CMAKE_OFF= -DOPTIMIZE:BOOL=true</programlisting>
|
|||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MOPT1}
|
||||
CMAKE_ARGS+= -DTEST:BOOL=true
|
||||
CMAKE_ARGS+= -DTEST:BOOL=true -DDEBUG:BOOL=true
|
||||
.else
|
||||
CMAKE_ARGS+= -DOPTIMIZE:BOOL=true
|
||||
.endif</programlisting>
|
||||
|
||||
<para>See <xref linkend="options-cmake_bool"/> for a shorter
|
||||
helper when the value is boolean.</para>
|
||||
</sect3>
|
||||
|
||||
<sect3 xml:id="options-cmake_bool">
|
||||
<title><varname><replaceable>OPT</replaceable>_CMAKE_BOOL</varname>
|
||||
and
|
||||
<varname><replaceable>OPT</replaceable>_CMAKE_BOOL_OFF</varname></title>
|
||||
|
||||
<para>When option <replaceable>OPT</replaceable> is selected,
|
||||
for each <replaceable>entry</replaceable> in
|
||||
<varname><replaceable>OPT</replaceable>_CMAKE_BOOL</varname>
|
||||
then
|
||||
<literal>-D<replaceable>entry</replaceable>:BOOL=true</literal>
|
||||
is appended to <varname>CMAKE_ARGS</varname>. When option
|
||||
<replaceable>OPT</replaceable> is <emphasis>not</emphasis>
|
||||
selected,
|
||||
<literal>-D<replaceable>entry</replaceable>:BOOL=false</literal>
|
||||
is appended to <varname>CONFIGURE_ARGS</varname>.
|
||||
<varname><replaceable>OPT</replaceable>_CMAKE_BOOL_OFF</varname>
|
||||
is the oposite,
|
||||
<literal>-D<replaceable>entry</replaceable>:BOOL=false</literal>
|
||||
is appended to <varname>CMAKE_ARGS</varname> when the option
|
||||
is selected, and
|
||||
<literal>-D<replaceable>entry</replaceable>:BOOL=true</literal>
|
||||
when the option is <emphasis>not</emphasis> selected. For
|
||||
example:</para>
|
||||
|
||||
<programlisting>OPTIONS_DEFINE= OPT1
|
||||
OPT1_CMAKE_BOOL= TEST DEBUG
|
||||
OPT1_CMAKE_BOOL_OFF= OPTIMIZE</programlisting>
|
||||
|
||||
<para>is equivalent to:</para>
|
||||
|
||||
<programlisting>OPTIONS_DEFINE= OPT1
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${PORT_OPTIONS:MOPT1}
|
||||
CMAKE_ARGS+= -DTEST:BOOL=true -DDEBUG:BOOL=true \
|
||||
-DOPTIMIZE:BOOL=false
|
||||
.else
|
||||
CMAKE_ARGS+= -DTEST:BOOL=false -DDEBUG:BOOL=false \
|
||||
-DOPTIMIZE:BOOL=true
|
||||
.endif</programlisting>
|
||||
</sect3>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue