views:

82

answers:

1

How would you organize your vc projects source code to share the same header file?

  1. put the header in a common folder, and have every vc projects include it.
  2. put the header in a vc project, and have the other projects include it as a link.
  3. copy the header file into every vc project

any better solution?

+1  A: 

To my mind, option 1 is preferable.

Option 2 sounds a little VC-specific and I'm not sure I'd do things that way.

The worst "smelling" option is option 3, at least the way you've presented it.

Before deciding, though, you should consider what version control system you're using. Some allow mapping of a singular file in the repository to several different places on the hard drive. We use this technique to enforce a "contract" (interface) between an Linux system and our Windows main application.

That way, all vc projects have "a copy in very project" but the source of each copy is a single file in the repository.

Peter K.
how to map the header file in SVN? using external link?
Benny
I'm not an SVN user, but it seems like SVN externals give this ability. http://svnbook.red-bean.com/en/1.0/ch07s03.html
Peter K.