Date: Tue, 28 Jun 2016 08:08:41 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r49014 - head/en_US.ISO8859-1/books/porters-handbook/makefiles Message-ID: <201606280808.u5S88fCm059192@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <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">
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606280808.u5S88fCm059192>