News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Inporting Compiler, linker and defines from pkgconfig for a project

Started by aditya_v, June 26, 2009, 02:30:36 PM

Previous topic - Next topic

aditya_v

How to accomplish this?
For eg:
I wanted to make a glfw application. Now, glfw defines a libglfw.pc file which has all the necessary, to make a app run. However, i need to manually specify the path to its libs, and headers.
Even then, the default glfw project template doesn't include libraries X11 Xrandr m, which i needed to add manually after looking at libglfw.pc. It also defines -D_REENTRANT which i don't know how to add to the project builder script.

I would really like to know how to get sensitive settings like these from pkgconfig directly.

Jenna

You can use the appropriate pkg-config call in the projects build-options ("Compiler settings -> Other options" for the includes and cppflags and "Linker settings -> Other linker settiings" for the libs).
Just add them included in backticks "`" and they will be automatically expanded by the C::B build-system.

To see how it works, you can have a look at a wizard-created wxWidgets project.

Example for gtk+-2.0:

`pkg-config --cflags gtk+-2.0`
and
`pkg-config --libs gtk+-2.0`

aditya_v

Thanks.I figured that part out.  :)

However, I was asking if it is possible to add these in the wizard generation template. I don't want todo it all the time.