Hello bjam developers!
I currently read through the docs for bjam and try to build my first project using. We currently need an automated build system in the current project to run directly from the version control system.
The doc which I read currently leaves many items open which I do not understand, despite the fact I see bjam as a very cool thing! far superior as make;)
These questions are open:
1. From the userman.pdf I learned that there is a possibility to use modules. Is there any location where I can what the modules do or how they work. Since such examples are not very well to understand:
userman.pdf page 47-48
-------
"Accessing environment variables
Many users would like to use environment variables in Jamfiles, for example, to control location of external libraries.
In many cases you better declare those external libraries in the site-config.jam file, as documented in the recipes
section. However, if the users already have the environment variables set up, it's not convenient to ask them to set up
site-config.jam files as well, and using environment variables might be reasonable.
In Boost.Build V2, each Jamfile is a separate namespace, and the variables defined in environment is imported into
the global namespace. Therefore, to access environment variable from Jamfile, you'd need the following code:
import modules ;
local SOME_LIBRARY_PATH = [ modules.peek : SOME_LIBRARY_PATH ] ;
exe a : a.cpp : <include>$(SOME_LIBRARY_PATH) ;"
-------
2. As I understood I can use user-config.jam to make default configurations for my project. I copied the user-config.jam into the project root, but it is not read, at least bjam issues warnings that toolset was not set and msvc is the default one. How can I specify in user-config.jam a default toolset? Or is the user-config-jam a file to declare available toolset, but toolspecification must be somewhere else? My user-config.jam contains:
import toolset : using ;
using msvc ;
3. How is it possible to specify the source location to 3d party lib (libpath)? I can't build a project with bjam v2 which uses boost libs. I don't want to enumerate each lib which my project depends on, but submit to the linker the lib path. My file content is:
import modules ;
local BOOST_STAGE_INCLUDE = [ modules.peek : BOOST_STAGE_INCLUDE ] ;
local BOOST_STAGE_LIBS = [ modules.peek : BOOST_STAGE_LIBS ] ;
exe MTSentry
: main.cpp <source>$(BOOST_STAGE_LIBS)
: <include>$(BOOST_STAGE_INCLUDE) <threading>multi
;
The resulting error is:
bjam.exe --v2 --toolset=msvc
error: at Jamroot:7
error: properties found in the 'sources' parameter for ./MTSentry
Removing the <source> option will build the app, but the linking fails, since boost/thread lib is not found. How can I specify a source directory for libs?
With Kind Regards,
Ovanes