summaryrefslogtreecommitdiff
path: root/doc/html/bbv2/faq/external.html
blob: 927053ca9efdf8ea376e10b8cd1acb727087c462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Can I get output of external program as a variable in a Jamfile?
    </title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<style type="text/css">
body { background-image: url('http://docbook.sourceforge.net/release/images/draft.png');
       background-repeat: no-repeat;
       background-position: top left;
       /* The following properties make the watermark "fixed" on the page. */
       /* I think that's just a bit too distracting for the reader... */
       /* background-attachment: fixed; */
       /* background-position: center center; */
     }</style>
<link rel="start" href="../../index.html" title="The Boost C++ Libraries">
<link rel="up" href="../faq.html" title="Chapter 27. Frequently Asked Questions">
<link rel="prev" href="s04.html" title="
      How to control the library order on Unix?
    ">
<link rel="next" href="s06.html" title="How to get the project-root location?
    ">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.htm">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../../../people/people.htm">People</a></td>
<td align="center"><a href="../../../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="s04.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s06.html"><img src="../../images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="bbv2.faq.external"></a>Can I get output of external program as a variable in a Jamfile?
    </h2></div></div></div>
<p>From time to time users ask how to run an external program and save
    the result in Jamfile variable, something like:
</p>
<pre class="programlisting">
local gtk_includes = [ RUN_COMMAND gtk-config ] ;
</pre>
<p>
      Unfortunately, this is not possible at the moment. However, if the
      result of command invocation is to be used in a command to some tool,
      and you're working on Unix, the following workaround is possible.
</p>
<pre class="programlisting">
 alias gtk+-2.0 : : : :
         &lt;cflags&gt;"`pkg-config --cflags gtk+-2.0`"
         &lt;inkflags&gt;"`pkg-config --libs gtk+-2.0`"
     ;
</pre>
<p>
      If you use the "gtk+-2.0" target in sources, then the properties
      specified above will be added to the build properties and eventually
      will appear in the command line. Unix command line shell processes
      the backticks quoting by running the tool and using its output --
      which is what's desired in that case. Thanks to Daniel James for
      sharing this approach.
    </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small></small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="s04.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../faq.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="s06.html"><img src="../../images/next.png" alt="Next"></a>
</div>
</body>
</html>