Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2007-10-30 12:37:52

Greg Landrum wrote, on 10/26/2007 12:01 AM:
> Hi,
> I'm considering moving a project I maintain from make to
> 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?
> thanks,
> -greg

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: 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
something like:

   "install dist : fooBar : <location>testExecs ;"

"install" docs:
<tag> feature: and search
for "tag feature" (used in the post I mention above).


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at