I'm using the latest version of boost-build found in boost 1.46. Given main.cpp
which depends on a.h
and b.h
, using the boost-build's ability to auto-detect dependencies my jam file is simply
exe my_prog : main.cpp ;
But, if there is an implementation file, b.cpp
, the object b.o
is not produced nor linked in. I'd like my build scripts to be minimal, and not require tweaking everytime I add a new file. So, how can I do this automatically?
Edited to reflect true intent vs. what I was asking for.
Is there any reason this won't work?
Doing it the way you want sounds painful and unpleasant, especially for someone new to boost-build. Plus there may be times when you only need the header, and not the cpp.
If your code is impeccably organized, and you only need the files in the current directory, you can get all the cpp files easily enough:
(There are other arguments to glob that will allow you to filter out backup/recovery files your editor may create. And there are other versions of glob that descend into child directories.)
If you have multiple cpp files needed by multiple final executables, you will be better off making a library with the
lib
rule and using that as one of the sources for your executable.