Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140498382
D6970.id54425.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6970.id54425.diff
View Options
Index: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
===================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
@@ -4342,7 +4342,7 @@
<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,10 +4352,56 @@
.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>
<sect3 xml:id="options-qmake_on">
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 25, 4:18 PM (8 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27251608
Default Alt Text
D6970.id54425.diff (2 KB)
Attached To
Mode
D6970: Document opt_CMAKE_BOOL and opt_CMAKE_BOOL_OFF.
Attached
Detach File
Event Timeline
Log In to Comment