Using JAM files NOT called 'jamfile.jam'
Added by David Cowan 12 months ago
I have a bunch of projects that I'm moving over to jamplus, each of which lives in my Z:\Projects folder.
Previously, I had a single jamfile.jam which had a big switch statement (switching on an environment var called PROJECT) which then did a subinclude on the specific project jam file.
e.g.
jam -sJAM_MODULES_USER_PATH="/Projects/jam" CONFIG=debug PLATFORM=win32 PROJECT=project1
However, I didn't like this approach... so I tried to change my structure to use a series of project<x>.jam files, and build them using
jam -sJAM_MODULES_USER_PATH="/Projects/jam" CONFIG=debug PLATFORM=win32 JAMFILE=project1.jam
This works fine -- each project is built separately, and only the project specified is built.
However, I can't work out how to generate the workspaces for these project<x>.jam files...
Invoking jam with
jam --workspace -gen=vs2008 -config=workspace.config project1.jam project1.workspace.vs2008
causes a whole bunch of errors
Reading platform [*] and config [debug]...
Z:/Projects/Jamfile.jam: No such file or directory
Reading platform [*] and config [release]...
Z:/Projects/Jamfile.jam: No such file or directory
It would appear that the workspace generator seems to always look for jamfile.jam instead of the jamfile that is specified on the command line.
Adding -jamflags=JAMFILE=project1.jam doesn't appear to help.
Any ideas whats going on? Am I missing something?
Dave
Replies (3)
RE: Using JAM files NOT called 'jamfile.jam'
-
Added by Joshua Jensen 11 months ago
Unfortunately, the key/value pairs specified through -jamflags are applied too late in the process. Instead, you need them applied pre-Jambase.
There is a way to do this, but it can only be done through the .config file. Either the JambaseText or JambaseVariables entries will do what you want (see http://jamplus.org/boards/1/topics/280#message-283).
Config = {
JambaseVariables = {
JAMFILE = 'project1.jam',
},
}
or:
Config = {
JambaseText = [[
JAMFILE = project1.jam ;
]],
}
Will this work for you? We could get a -jambaseflags command line option added, too.
Josh
RE: Using JAM files NOT called 'jamfile.jam'
-
Added by David Cowan 11 months ago
No - that should work just fine... I'll just have a .config file for each project - no biggy.
I'll try it shortly, and post back on how I got on.
Thanks Josh.
Dave
RE: Using JAM files NOT called 'jamfile.jam'
-
Added by David Cowan 11 months ago
Unfortunately, neither of the suggested settings appear to have worked...
My config file current reads...
Config =
{
JambaseVariables = {
JAMFILE = "project1.jam",
},
Configurations =
{
"debug",
},
JamFlags =
{
},
Platforms =
{
"ios",
"iossimulator",
},
SubIncludes =
{
{
"AppRoot",
"$(sourceRootPath)",
},
},
JamModulesUserPath = "$(sourceRootPath)jam",
}
Debug output appears to indicate it's still looking for 'jamfile.jam'
Dave
(1-3/3)