Author Topic: Shared source folder, multiple projects  (Read 7885 times)

msturner

  • Guest
Shared source folder, multiple projects
« on: September 18, 2012, 07:54:54 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(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!]

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: Shared source folder, multiple projects
« Reply #2 on: September 18, 2012, 11:46:20 am »
- 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.