Reputation: 7878
I am trying to setup SCons to build my project and am having a hard time figuring out exactly how to organize things. It consists of basically the following parts:
Module
: A separate small c project that compiles a small library already setup with SCons.
Core
: Another c project already set up with Scons. It generates some code by calling TheScript
on some files internal to the project.
Main
: A project that directly uses files in both Module
and Core
; it generates code by invoking TheScript
on a file within Module
and it needs to include both source files within Core
and library files generated by building Core
.
TheScript
A single python file that lives by itself somewhere.
My question is how do I arrange this stuff? For Core
and Main
, I need both projects to somehow invoke the newest version of TheScript
. Currently I have a symlink to the script in each project directory, but that is hardly a long term solution. The same problem comes up when I want to refer between the projects: I don't want to simply enter magic paths that work on my machine, but I do want to keep them as standalone projects.
What is a good way to solve this? I've seen version control software used for something like this, where dependency projects are pulled in, but I have so far only used bazaar
for straight up version control. I have no idea where to begin with the problems I have described. I don't need specific examples in bazaar - general concepts and pointers to documentation will do nicely.
Upvotes: 0
Views: 573
Reputation: 10357
Normally this would be done with a SCons hierarchical build Hierarchical builds But if you want to keep both Core and Main as stand-alone projects, this wont help. Ive never tried, but maybe you could have a Sconscript AND a SConstruct in both Core and Main. The SConsctruct would allow it to be a stand-alone project, while the SConscript would allow it be built all together, thus allowing for correct dependancy checking.
You could organize the project as follows:
.
|-- SConstruct
|-- Core
| |--
| |-- SConscript
| `-- SConstruct
|-- Main
| |--
| |-- SConscript
| `-- SConstruct
`-- Module
|--
`-- SConscript
As for the latest version of TheScript, you could invoke it in the SConscript files without specifying the path, and in the root level SConstruct, pull in the Unix Env PATH variable like this: Propagating PATH From the External Environment
Additionally, you could consider the SCons Repository function: Building From Code Repositories in the SCons user's guide. It wont let me post more than 2 hyperlinks for spam prevention.
Hope this helps,
Brady
Upvotes: 1