• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# showcasing several default install directories
2install a1 : a : <location>(bindir) ;
3install a2 : a : <location>(libdir)/a2 ;
4install (sbindir)/a3 : a ;
5
6# using a custom prefix; the file will be installed into foo/bar/bin/a4
7install (bindir)/a4 : a : <install-prefix>foo/bar ;
8
9# this one deduces installed package name to be the basename of the project
10# directory, so e.g. on Linux the file will be installed installed into
11# /usr/local/share/doc/<name of project's directory>/a5
12install (docdir)/a5 : a : <install-prefix>bar/baz ;
13
14# use a custom named directory; its default on Linux is /usr/local/share/xyz/
15import stage ;
16stage.add-install-dir foodir : xyz : datadir ;
17install (foodir)/a6 : a ;
18
19
20# another custom named directory, this one appends package name like docdir;
21# so, e.g. on Linux it defaults to /usr/local/lib/named-install-dirs
22stage.add-install-dir privatedir : "" : libdir : package-suffix ;
23install (privatedir)/a7 : a ;
24
25# using stage.get-package-name
26make a8 : a : @write-dirs : <staging-prefix>p/q/r <install-bindir>/bin ;
27
28rule write-dirs ( target : sources * : properties *  )
29{
30    import property-set ;
31    import print ;
32    local ps = [ property-set.create $(properties) ] ;
33    local pn = [ stage.get-package-name $(ps) ] ;
34    print.output $(target) ;
35    print.text
36        [ stage.get-dir docdir : $(ps) : $(pn) ]
37        [ stage.get-dir docdir : $(ps) : $(pn) : staged ]
38        [ stage.get-dir docdir : $(ps) : $(pn) : relative ]
39        [ stage.get-dir docdir : $(ps) : $(pn) : relative staged ]
40        [ stage.get-dir bindir : $(ps) : $(pn) : relative ]
41      : overwrite
42      ;
43}
44
45# using staging prefix; on Linux installs into q/r/s/share/a9
46install (datarootdir)/a9 : a : <staging-prefix>q/r/s ;
47
48
49build-project x ;
50
51# Copyright 2020 Dmitry Arkhipov
52# Distributed under the Boost Software License, Version 1.0.
53# (See accompanying file LICENSE_1_0.txt or copy at
54# http://www.boost.org/LICENSE_1_0.txt)
55