From: Phillip Seaver (phil_at_[hidden])
Date: 2007-10-30 12:37:52
Greg Landrum wrote, on 10/26/2007 12:01 AM:
> I'm considering moving a project I maintain from make to boost.build
> and have encountered what seems like a relatively simple problem: I'd
> like to be able to specify the name of the files created by exe rules.
> For example, I'd like to be able to do something like:
> exe myExe : myExe.cpp : <name>fooBar.exe ;
> and be sure that the output file from this rule is name fooBar.exe, no
> matter what system I'm on or what type of build I'm doing.
> Then when I do a rule like:
> install testExecs : myExe ;
> I will end up, again regardless of system or build type, with the
> file: testExecs/fooBar.exe
> Is this possible?
Well, you could do:
exe fooBar : myExe.cpp ;
...and that would get you fooBar.exe on Windows (at least). The name of
the output file is based on the name of the target -- see
If you really want the ".exe" extension on all platforms, you could try
import type : change-generated-target-suffix ;
type.change-generated-target-suffix EXE : : exe ;
You'd probably have to put it in your root jam file, though, or you
could modify exe.jam in your boost-build distribution to just have "type
EXE : exe ;". That said, boost-build tries to go with the platform
naming convention, and most unix platforms don't use .exe (to the best
of my knowledge).
Another way to handle it could be something like this:
http://article.gmane.org/gmane.comp.lib.boost.build/13019 On re-reading
the post, it's not clear that I do something like "exe foo : foo.c :
<tag>@apago_tag ;" to get the desired affect. :-)
As far as the install goes, the first parameter to install ("testExecs"
in your example) is just the name of the install target. It doesn't
affect the destination or name of the files installed. You may want
"install dist : fooBar : <location>testExecs ;"
<tag> feature: http://boost.org/doc/html/bbv2/reference.html and search
for "tag feature" (used in the post I mention above).
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk