InstallingFor installing a built target you should use the
- stage rule, which follows the install rule, which follows the common syntax. For
example:
-stage dist : hello helpers ;
+install dist : hello helpers ;
will cause the targets hello and helpers to
- be moved to the dist directory. The directory can
+ be moved to the dist directory, relative to
+ Jamfile's directory. The directory can
be changed with the location property:
-stage dist : hello helpers : <location>/usr/bin ;
+install dist : hello helpers : <location>/usr/bin ;
While you can achieve the same effect by changing the target name to
/usr/bin, using the location
- property is better because it allows you to use a memnonic target name on the
- command line and in other targets.
+ property is better, because it allows you to use a memnonic target
+ name.
The location property is especially handy when the location
is not fixed, but depends on build variant or environment variables:
-stage dist : hello helpers : <variant>release:<location>dist/release
+install dist : hello helpers : <variant>release:<location>dist/release
<variant>debug:<location>dist/debug ;
-stage dist2 : hello helpers : <location>$(DIST) ;
+install dist2 : hello helpers : <location>$(DIST) ;
See also conditional
properties and environment variables
@@ -1430,18 +1431,13 @@ stage dist2 : hello helpers : <location>$(DIST) ;
Specifying the names of all libraries to install can be boring. The
- stage allows to specify only the top-level executable
+ install allows you to specify only the top-level executable
targets to install, and automatically install all dependencies:
-stage dist : hello
- : <traverse-dependencies>on <include-type>EXE
- <include-type>LIB
+install dist : hello
+ : <install-dependencies>on <install-type>EXE
+ <install-type>LIB
;
-
will find all targets that hello depends on, and install
all of the which are either executables or libraries. More
@@ -1459,12 +1455,33 @@ stage dist : hello
rule can be used when targets must be installed into several
directories:
-alias install : install-bin install-lib ;
-stage install-bin : applications : /usr/bin ;
-stage install-lib : helper : /usr/lib ;
+install install : install-bin install-lib ;
+install install-bin : applications : /usr/bin ;
+install install-lib : helper : /usr/lib ;
-
+
+ Because the install rule just copies targets, most
+ free features see the definition of "free" in .
+ have no effect when used in requirements of the install.
+ The only two which matter are
+
+ dependency and, on Unix,
+ dll-path.
+
+
+
+
+ (Unix specific). On Unix, executables built with Boost.Build typically
+ contain the list of paths to all used dynamic libraries. For
+ installing, this is not desired, so Boost.Build relinks the executable
+ with an empty list of paths. You can also specify additional paths for
+ installed executables with the dll-path feature.
+
+
+
+
@@ -1581,8 +1598,31 @@ unit-test helpers_test : helpers_test.cpp helpers ;
-
-
+
+
+ dependency
+
+
+
+
+ Introduces a dependency on the target named by the
+ value of this feature (so it will be brought
+ up-to-date whenever the target being declared is), and
+ adds its usage requirements to the build properties
+
+ of the target being declared. The dependency is not used
+ in any other way. The primary use case is when you want
+ the usage requirements (such as #include paths) of some
+ library to be applied, but don't want to link to it.
+
+
+
+
+
+
use
diff --git a/v2/test/stage.py b/v2/test/stage.py
index 8f14fd00d..4188582c3 100644
--- a/v2/test/stage.py
+++ b/v2/test/stage.py
@@ -128,7 +128,7 @@ foo() { }
t.write("Jamfile", """
lib l : l.cpp ;
exe a : a.cpp l ;
-stage dist : a : on EXE LIB ;
+stage dist : a : on EXE LIB ;
""")
t.write("project-root.jam", "")
@@ -147,7 +147,7 @@ lib l2 : l2.cpp ;
lib l3 : l3.cpp ;
lib l : l.cpp :