svn commit: r49014 - head/en_US.ISO8859-1/books/porters-handbook/makefiles

Mathieu Arnold <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
Author: mat
Date: Tue Jun 28 08:08:40 2016
New Revision: 49014
URL: https://svnweb.freebsd.org/changeset/doc/49014

Log:
  Document opt_CMAKE_BOOL and opt_CMAKE_BOOL_OFF.
  
  PR:		210576
  Reviewed by:	wblock
  Sponsored by:	Absolight
  Differential Revision:	https://reviews.freebsd.org/D6970

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Mon Jun 27 17:40:35 2016	(r49013)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Tue Jun 28 08:08:40 2016	(r49014)
@@ -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,10 +4352,56 @@ OPT1_CMAKE_OFF=	-DOPTIMIZE:BOOL=true</pr
 .include &lt;bsd.port.options.mk&gt;
 
 .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 &lt;bsd.port.options.mk&gt;
+
+.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">
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.