1
This folder contains configuration files for libraries.
2
Configurations are stored in XML format and must have .xml extension.
4
The main skeleton of library configuration is as follows:
7
<library name="Library Name" global_var="Global Var Name">
9
<!--... Global configuration here ...-->
12
<!--... Library configurtion 1 ...-->
16
<config description="Some description">
17
<!--... Library configurtion 2 ...-->
21
<!--... Some shared configuration ...-->
23
<!--... Library configurtion 3 ...-->
27
<!--... Library configurtion 4 ...-->
31
<!--... more configurations here ...-->
36
LibFinder assumes that each library may have different number of configurations
37
(static library / dll / debug version etc. ), each of these configurations is
38
set inside <config> </config> node. If configuration is in nested block (
39
inside other configuration node), it will inherit settings of all parent nodes
40
and global configuration. Final configurations are made from <config> nodes which
41
don't have sub-configurations.
43
Configurable options are described below.
48
Filters are used to show some requirements for the library before it's detected.
49
All filters are located inside <filters> node in <config> one. There are following
54
file option is used to to notify that library must have specified file. File names are
55
relative to base library directory. There's no need to check all files included with library.
56
But given list of files must not be ambiguous. Here's example of file option from wxWidgets library:
58
<file name="include/wx/wx.h"/>
59
<file name="include/wx/wxprec.h"/>
63
platform filter may be used to allow specific configuration for one platform only: for example:
65
<platform name="win"/>
67
will allow this cofiguration (all all sub-configurations) to be added for windows hosts only.
69
There are following names which can be used:
71
win, windows, lin, linux, unix, un*x, mac, macosx,
72
bsd, freebsd, netbsd, openbsd, darwin, solaris
74
More than one platform may be specified in one filter, for example:
76
<platform name="win|lin"/>
78
will allow this configuration on windows and linux hosts
82
compiler filter may be used to notify that given configuration is dedicated for one compiler only.
83
Similarily to platform, you may specify more than one compiler. Names of compilers are declared in
84
compiler plugin. In the time of wrigting this section the full list of supported compilers was:
86
cygwin, dmc, dmd, gdc, arm-elf-gcc, avr-gcc, msp430-gcc, ppc-gcc,
87
tricore-gcc, icc, msvctk, msvc8, ow, sdcc, tcc, gcc, mingw(?)
89
Example of compiler filter:
90
<compiler name="dmc|gcc"/>
94
this filter may be used to check whether there's specified executable available on host system.
95
It may be used to check whether there's some configuration-script available. For example:
97
<exec name="wx-config"/>
99
checks whether we can incoke wx-config which is required on unix host to fetch configuration of
104
In compiler settings section you may set configuration which will be added into current compilation options
105
for the compile time. All settings should be placed inside <settings> node.
107
There are following settings which can be added:
111
path option is used to add one of paths for library configuration. Like in global vars, there are
112
three types of paths: include, lib, obj. These paths should be global, what can be done easily by using variables (it will be describedd later). Global Variable allow only one path to be defined
113
but LibFinder tries to set additional directories through CFLAGS and LFLAGS. Paths can be defined
116
<path include="include path"/>
117
<path lib="lib path"/>
118
<path obj="obj path"/>
122
this option is used to add library to linker settings, for example:
126
will add wxmsw26 library to build options
130
this option can be used to add extra defines like:
131
<add define="HAVE_W32API_H"/>
133
- Extra compiler / linker flags
135
this option can be used to set additional compiler / linker flags. Tag describing
136
flags can be defined like in following forms (example from wxWidgets configuration):
138
<add cflags="-DHAVE_W32API_H"/>
139
<add lflags="-lwxmsw26"/>
141
The example above show how to add define and library to gcc-like compilers. Note that
142
preffered way should be through <add lib="..."/> and <add define="..."/>
146
There may be special switch dedicated to pkg-config available in <config> section.
147
This switch is both filter and setting so it should be placed directly inside <config>
148
node. It's main purpose is to check whether pkg-config does have configuration of
149
some library and add pkg-config queries while compiling sources, for example:
151
<config description="OpenGL Framework (pkg-config)">
152
<pkgconfig name="libglfw"/>
155
checks whether there's libglfw available in pkg-config and will let use it when such
156
configuration will be choosen.
158
Such extra configuration dedicated to pkg-config entry is also generated automatically
159
when name of global variable is same as pkg-config entry.
163
LibFinder allow to use variables what gives more flexibility.
164
In order to use variable, You can use $(VARIABLE_NAME) anywhere in path, flags options and
165
in library name. If variable named VARIABLE_NAME is declared, it will be replace by
168
There's one variable always defined: $(BASE_DIR) and it contains global path to library root folder
169
(paths of required files are relative to this base path). And it should be always used when declaring
170
paths for this library, like:
172
<path include="$(BASE_DIR)/include"/>
174
Additional variables may be produced from names of directories in required files. If there is
175
*$(VARIABLE_NAME) instead of directory, it does mean that any directory will match here
176
and that variable named VARIABLE_NAME wil be set to this directory name. F.ex. :
178
<file name="lib/*$(CONFIG_NAME)/msw/wx/setup.h"/>
180
will set variable CONFIG_NAME with names of all directories inside lib, containing msw/wx/setup.h.
181
(Of course, this path will be used when other file requirements are met).
183
If variable is declared in more than one path, is must be same in all paths, otherwise, this will
184
be threated like file name mismatch.