[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advice on the project structure for a library

From: Ralf Wildenhues
Subject: Re: Advice on the project structure for a library
Date: Tue, 3 Jun 2008 13:22:45 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* Jef Driesen wrote on Tue, Jun 03, 2008 at 12:31:29PM CEST:
>>> CFLAGS=-I${includedir}
>>> #include <libfoo/header.h>
>>> or
>>> CFLAGS=-I${includedir}/libfoo
>>> #include <header.h>
>> It's purely a matter of preference.  You're right to segregate the  
>> headers, but a project shouldn't mandate one #include/-I style over 
>> another.
> I don't really want to mandate a specific style to the users of my  
> library. I just want to use the first style inside my own library, and  
> right now that doesn't work.

Good thinking.  The first style helps avoid name clashes with generic
header file names.

> Suppose that in one of my public headers, I include one of the other  
> header files, with <libfoo/headerx.h> style. Now when I compile the  
> library in my src tree, it fails because there is no such header present  
> in my src tree or system wide (not installed yet). The same for the  
> examples.

Can you reorganize your source tree to look more like the installed
tree?  IOW, move headers in a subdirectory libfoo or include/libfoo.
The biggest reason against doing so, namely that CVS doesn't track
renames, isn't very relevant any more nowadays.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]