Stoppt die Vorratsdatenspeicherung! Jetzt klicken & handeln!Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

Workaround for pkg-config - ecplise CDT Problem

September 22, 2007 on 9:17 pm | In english, linux, open source, python, technic |

In the last days I started to learn a bit more GTK and GDK development. I like eclipse very much, but the new CDT version 4.0 have still no real feature to use the pkg-config tool from the freedesktop organisation. Thats makes me a bit nervous. In the first two small projects I copied all the include and lib pathes from the pkg-config output.

Example output:

-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0

You know, that is not really funny. Some evenings ago I developed a small python script to solve this problem a bit.

The biggest problem is that eclipse creates the important XML node after configuring a extra directory or/and library. After you add for example a directory called “aaa” and an library called “aaa” you can close eclipse and run the python script.

pkg2eclpise.py -p <path to projectpath> -c <pkg-config params>

e.g.:

pkg2eclipse.py -p FirstGTKWindow/ -c “gtk-2.0 –cflags –libs”

After running the script, restart eclipse and you see all the directorys and librarys in your manipulated project. You can rerun the script again and again. The script avoid duplicated entrys

Have fun with the great CDT 4.0 and the nice fast code completion feature.

pkg2eclipse.py

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • DZone
  • ThisNext
  • MisterWong
  • Reddit
  • StumbleUpon

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. Very useful tool. It should be integrated in following CDT releases.

    Comment by Pablo — December 18, 2008 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^