|
Lines 5422-5427
Link Here
|
| 5422 |
</table> |
5422 |
</table> |
| 5423 |
</sect2> |
5423 |
</sect2> |
| 5424 |
|
5424 |
|
|
|
5425 |
<sect2 id="using-cmake"> |
| 5426 |
<title>Using <command>cmake</command></title> |
| 5427 |
|
| 5428 |
<para>If your port uses <application>CMake</application>, |
| 5429 |
define <literal>USES= cmake[:outsource]</literal>.</para> |
| 5430 |
|
| 5431 |
<table frame="none"> |
| 5432 |
<title>Variables for Ports That Use |
| 5433 |
<command>cmake</command></title> |
| 5434 |
|
| 5435 |
<tgroup cols="2"> |
| 5436 |
<thead> |
| 5437 |
<row> |
| 5438 |
<entry>Variable</entry> |
| 5439 |
<entry>Means</entry> |
| 5440 |
</row> |
| 5441 |
</thead> |
| 5442 |
|
| 5443 |
<tbody> |
| 5444 |
<row> |
| 5445 |
<entry><makevar>CMAKE_ARGS</makevar></entry> |
| 5446 |
<entry>Port specific <application>CMake</application> flags |
| 5447 |
to be passed to the <command>cmake</command> binary. |
| 5448 |
</entry> |
| 5449 |
</row> |
| 5450 |
|
| 5451 |
<row> |
| 5452 |
<entry><makevar>CMAKE_BUILD_TYPE</makevar></entry> |
| 5453 |
<entry>Type of build (<application>CMake</application> |
| 5454 |
predefined build profiles). Default is |
| 5455 |
<literal>Release</literal> if <makevar>WITH_DEBUG</makevar> |
| 5456 |
is not set, otherwise <literal>Debug</literal>. |
| 5457 |
</entry> |
| 5458 |
</row> |
| 5459 |
|
| 5460 |
<row> |
| 5461 |
<entry><makevar>CMAKE_ENV</makevar></entry> |
| 5462 |
<entry>Environment variables to be set for |
| 5463 |
<command>cmake</command> binary. Default is |
| 5464 |
<literal>${CONFIGURE_ENV}</literal>. |
| 5465 |
</entry> |
| 5466 |
</row> |
| 5467 |
|
| 5468 |
<row> |
| 5469 |
<entry><makevar>CMAKE_SOURCE_PATH</makevar></entry> |
| 5470 |
<entry>Path to the source directory. Default is |
| 5471 |
<literal>${WRKSRC}</literal>. |
| 5472 |
</entry> |
| 5473 |
</row> |
| 5474 |
</tbody> |
| 5475 |
</tgroup> |
| 5476 |
</table> |
| 5477 |
|
| 5478 |
<para> |
| 5479 |
<application>CMake</application> supports the following build |
| 5480 |
profiles: <literal>Debug</literal>, <literal>Release</literal>, |
| 5481 |
<literal>RelWithDebInfo</literal> and <literal>MinSizeRel</literal>. |
| 5482 |
<literal>Debug</literal> and <literal>Release</literal> profiles |
| 5483 |
respect system <literal>*FLAGS</literal>, |
| 5484 |
<literal>RelWithDebInfo</literal> and <literal>MinSizeRel</literal> |
| 5485 |
will set <makevar>CFLAGS</makevar> to "-O2 -g" and "-Os -DNDEBUG" |
| 5486 |
correspondingly. The lower-cased value of |
| 5487 |
<makevar>CMAKE_BUILD_TYPE</makevar> is exported to the |
| 5488 |
<makevar>PLIST_SUB</makevar> and should be used if port installs |
| 5489 |
<literal>*.cmake</literal> files depending on the build type (see |
| 5490 |
<filename role="package">deskutils/strigi</filename> for example). |
| 5491 |
Please note that some projects may define their own build profiles |
| 5492 |
and/or force particular build type by setting |
| 5493 |
<literal>CMAKE_BUILD_TYPE</literal> in <filename>CMakeLists.txt |
| 5494 |
</filename> files. In order to make port for such project respect |
| 5495 |
<makevar>CFLAGS</makevar> and <makevar>WITH_DEBUG</makevar> the |
| 5496 |
<literal>CMAKE_BUILD_TYPE</literal> definitions must be removed |
| 5497 |
from those files. |
| 5498 |
</para> |
| 5499 |
|
| 5500 |
<para>Most <application>CMake</application> based projects support |
| 5501 |
out-of-source way of buildling. The ouf-of-source build for a port |
| 5502 |
can be requested by using <literal>:outsource</literal> suffix. In |
| 5503 |
this case <makevar>CONFIGURE_WRKSRC</makevar>, |
| 5504 |
<makevar>BUILD_WRKSRC</makevar> and <makevar>INSTALL_WRKSRC</makevar> |
| 5505 |
will be set to <literal>${WRKDIR}/.build</literal> and this |
| 5506 |
directory will be used to keep all files generated during |
| 5507 |
configuration and build stages, leaving the source directory intact. |
| 5508 |
</para> |
| 5509 |
|
| 5510 |
<example id="using-cmake-example"> |
| 5511 |
<title><literal>USES= cmake</literal> example</title> |
| 5512 |
<para> |
| 5513 |
The following snippet demonstrates the use of |
| 5514 |
<application>CMake</application> for a port. |
| 5515 |
<makevar>CMAKE_SOURCE_PATH</makevar> is not usually required, but |
| 5516 |
can be set when the sources are not located in the top directory, |
| 5517 |
or if only a subset of the project is intended to be built by the |
| 5518 |
port. |
| 5519 |
</para> |
| 5520 |
<programlisting>USES= cmake:outsource |
| 5521 |
CMAKE_SOURCE_PATH= ${WRKSRC}/subproject</programlisting> |
| 5522 |
</example> |
| 5523 |
</sect2> |
| 5524 |
|
| 5425 |
<sect2 id="using-scons"> |
5525 |
<sect2 id="using-scons"> |
| 5426 |
<title>Using <command>scons</command></title> |
5526 |
<title>Using <command>scons</command></title> |
| 5427 |
|
5527 |
|
|
Lines 6902-6910
Link Here
|
| 6902 |
<title><makevar>USE_KDE4</makevar> Example</title> |
7002 |
<title><makevar>USE_KDE4</makevar> Example</title> |
| 6903 |
|
7003 |
|
| 6904 |
<para>This is a simple example for a KDE 4 port. |
7004 |
<para>This is a simple example for a KDE 4 port. |
| 6905 |
<makevar>USE_CMAKE</makevar> instructs the port to utilize |
7005 |
<literal>USES= cmake:outsource</literal> instructs the port |
| 6906 |
<application>CMake</application> — configuration |
7006 |
to utilize <application>CMake</application> — configuration |
| 6907 |
tool widely spread among KDE 4 projects. |
7007 |
tool widely spread among KDE 4 projects |
|
|
7008 |
(see <xref linkend="using-cmake"/> for detailed usage). |
| 6908 |
<makevar>USE_KDE4</makevar> brings dependency on KDE |
7009 |
<makevar>USE_KDE4</makevar> brings dependency on KDE |
| 6909 |
libraries and makes port using |
7010 |
libraries and makes port using |
| 6910 |
<command>automoc4</command> at build stage. |
7011 |
<command>automoc4</command> at build stage. |
|
Lines 6915-6921
Link Here
|
| 6915 |
Qt 4 components, they should be specified in |
7016 |
Qt 4 components, they should be specified in |
| 6916 |
<makevar>USE_QT4</makevar>.</para> |
7017 |
<makevar>USE_QT4</makevar>.</para> |
| 6917 |
|
7018 |
|
| 6918 |
<programlisting>USE_CMAKE= yes |
7019 |
<programlisting>USES= cmake:outsource |
| 6919 |
USE_KDE4= kdelibs kdeprefix automoc4 |
7020 |
USE_KDE4= kdelibs kdeprefix automoc4 |
| 6920 |
USE_QT4= moc_build qmake_build rcc_build uic_build</programlisting> |
7021 |
USE_QT4= moc_build qmake_build rcc_build uic_build</programlisting> |
| 6921 |
</example> |
7022 |
</example> |