News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Shared source folder, multiple projects

Started by msturner, September 18, 2012, 07:54:54 AM

Previous topic - Next topic

msturner

Hi all,

I have several projects that share a common folder of source files - a "library" of utility functions and classes. These are C/C++ source files, not compiled LIBs. This arrangement allows me to freely modify the shared functions, and all projects that make use of those shared source files immediately benefit from the updates. I am a single developer with full control over all the projects concerned.

This arrangement is complicated by the way Code::Blocks project files store and present paths to source files. I cannot freely move projects to other folders without breaking paths to the shared source files. There are many source files, which makes updating paths to each file a chore. Often the best solution is to open the CBP project file in another text editor and do a find-and-replace. It would be handy if file paths could be relative to some kind of environment variable.

I am wondering if anyone has a good solution to this problem, or can describe their own methods for sharing code between project files.

Thanks in advance.

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jarod42

- With a real library, you other projects also benefit from changes (and compilation should be faster since the library is compiled only once).

I personally use Premake to generate my project,
so it is easy to reorganize source tree and then regenerate project.