panda3d icon indicating copy to clipboard operation
panda3d copied to clipboard

Generate pkg-config files

Open Lecrapouille opened this issue 6 years ago • 2 comments

Hi,

I never developed with Panda3D but I needed to compile C++ code using Panda (Debian). This is a simple build shell script calling -L/usr/lib/panda3d -lpanda ... but it looks like Panda3D does not offer the installation of pkg-config files. I looked for one inside the .deb file I compiled, as well in /usr/lib/pkgconfig I found nothing!

So, it may be interesting to create one. In addition, this is very simple to make and for the developer more easier :) Just an idea:

file /usr/lib/pkgconfig/panda.pc

prefix=/usr
exec_prefix=/usr/bin
libdir=/usr/lib/panda3d
includedir=/usr/include/panda3d
Name: Panda3D
Description:  an open-source, completely free-to-use engine for realtime 3D games
Version: 1.10.1
Libs: -L${libdir} -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct -lpthread
Cflags: -I${includedir} -I/usr/include/python2.7

Examples:

  • pkg-config panda --libs will return -L/usr/lib/panda3d -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct -lpthread
  • and pkg-config panda --cflags will return -I/usr/include/panda3d -I/usr/include/python2.7

Lecrapouille avatar Nov 18 '19 20:11 Lecrapouille

PS: for example, the script is using -lp3pystub which is no longer exists in my version and it's lib path was -L/usr/lib/panda3d while mine is -L/usr/lib/x86_64-linux-gnu/panda3d. pkg-config allows fixing this kind of problems.

Lecrapouille avatar Nov 18 '19 20:11 Lecrapouille

CC'ing @CFSworks, who is working on the CMake port which aims to provide CMake integration so that the Panda3D libraries can be easily linked in by CMake users.

I like the idea of providing pkg-config files for non-CMake users.

rdb avatar Nov 20 '19 09:11 rdb