![]() |
The alias rule gives alternative name to
a group of targets. For example, to give the name
core to a group of three other targets with the
following code:
alias core : im reader writer ;
Using core on the command line, or in the source list
of any other target is the same as explicitly using
im, reader, and
writer, but it is just more convenient.
Another use of the alias rule is to change build
properties. For example, if you always want static linking for a
specific C++ Boost library, you can write the following:
alias threads : /boost/thread//boost_thread : <link>static ;
and use only the threads alias in your Jamfiles.
You can also specify usage requirements for the
alias target. If you write the following:
alias header_only_library : : : : <include>/usr/include/header_only_library ;
then using header_only_library in sources will only add an
include path. Also note that when there are some sources, their usage
requirements are propagated, too. For example:
lib lib : lib.cpp : : : <include>. ; alias lib_alias ; exe main : main.cpp lib_alias ;
will compile main.cpp with the additional include.