pb : want to link a library only in some configurations

Eric Klumpp klumpp at nerim.fr
Wed Jul 10 15:13:01 BST 2002


Hi,

I work on an application for the signal processing, in which a hierarchy 
of several treatments can be executed. The available treatments depend 
on the library installed. My problem is to link only the libraries 
installed, and to compile the associated parts only when the libraries 
are present.

Actually, what I do is to define or not strings ("#define 
__WITH_LIB_xxx__") for each available libraries in a header file 
"config.h". Then in the source files, this header file is included, and 
when necessar I use the preprocessor command "#ifdef __WITH_LIB_xxx__" 
to compil or not the parts related to each libraries. I must also 
manually change the makefiles after the configure process, in order to 
add the library paths and the include paths related to each libraries. I 
used this solution at the beginning, but now I would like to process 
this automatically, or something else that work.

The configure process can certainly automatically see if the libraries 
are present or not and then append them or not to the linking process, 
but I don't see how to know in my source files if the associated parts 
should or not be compiled !

I already searched in some documentations how to do this, but I probably 
don't have the good documentation ! Does anyone know where I can find 
the solution, perhaps in the kdevelop documentation, or in a doc 
available on the net ?

Thanks,

Eric



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list