[CMake] prefered header version?

Hendrik Sattler post at hendrik-sattler.de
Fri Aug 17 19:00:44 EDT 2007


Am Samstag 18 August 2007 00:11 schrieb Stefan Kögl:
> I'm not new to c++ programming, but new to cmake .
>
> I have started an opensource project at berlios.
> I don't know if I'm allowed to name it here, but if you want to know, feel
> free to ask me for the url and name.
>
> Now I want to make a library version bump while keeping the stable version.

I guess you mean the API? Or the ABI?

> The stable version is important for the system and must not be deleted or
> overwritten. The versions are quite different but the header names are the
> same;(
>
> - The unstable version is installed in /usr/local
> - The stable one in /usr

Is this you own lib? If yes, why are you concerned with install locations at 
all?

> How to prefer a header e.g "/usr/local/include/foo-0.25/foo/*.h"
> over "/usr/include/foo/*.h" ?
>
> I tried a cmake command:
>
> INCLUDE_DIRECTORIES(BEFORE /usr/local/include/foo-0.25)
>
> But g++ still takes the headers in /usr but not the newer ones
> in /usr/local/include. While the time of coexistence will be short, but
> repetitive, it would be nice to point me to a convenient solution.

I guess that g++ documentation is the key part, here.
Check what the command line looks like by issuing "make VERBOSE=1". If you 
use "BEFORE SYSTEM", it should result in an -isystem option.

HS


More information about the CMake mailing list