thanks for your positive feedback. I must say however that I prefer my version for the following reasons:

While you a presumably dreaming of pkgconfig at night ;-) (given your Linux history...), I can assure you that in KDE4 based desktops pkgconfig does NOT play a significant role at all! Hence  a significant number of Linux users will not even have pkgconfig installed and errors would be thrown at them after starting qmake. My version is more elementary i.e. it does not invoke any auxiliary programs whatsoever. Many KDE4 users might never have heard what *.pc files are etc. 

My syntax using directly the various occuring liblua names is selfexplanatory without being inferior in performance. Moreover, your code only looks a bit shorter, since you forgot to take care of the possibility that the user has forgotten to install ANY liblua!

isEmpty (LUANAME) {error("No shared Lua library found!")}


On 03/30/2012 07:44 PM, Pat Suwalski wrote:
I like this approach with the loop (does it break when found?), but I 
would do it with the .pc files rather than checking for file existence 
for the following reasons:

1) We know of only two naming schemes for .pc files (lua.pc, lua-x.y.pc)
2) These almost never exist in /usr/lib.
     - RedHat would be /usr/lib64
     - Debian/Ubuntu: /usr/lib/x86_64-linux-gnu
3) pkg-config uses a system-set search path
4) This does not add the include path (pkg-config will do this):

If the provided list is not right, I'm sure we'll hear about it or the 
distro would patch it locally. The goal is to match most installations.

As a side note, I have lua-5.2 on my system; if Celestia builds against 
it, I think it should be added to the and qmake files.

I propose the following (a little simpler):

unix {
     CONFIG += link_pkgconfig

     !system(pkg-config --exists $$LUAPC) {

     INCLUDEPATH += /usr/local/cspice/include
     LIBS += -ljpeg /usr/local/cspice/lib/cspice.a


On 29/03/12 08:52 AM, Fridger Schrempp wrote:
Sorry, I forgot to include the modified file for your
convenience. Moreover, I added an error message, in case no shared Lua
library was found in the distro!

Like so:

unix {
INCLUDEPATH += /usr/local/cspice/include

LIST = lua-5.1 lua5.1 lua51 lua
for(lib, LIST):exists(/usr/lib/lib$${lib}.so):LUANAME = $${lib}
isEmpty (LUANAME) {error("No shared Lua library found!")}

LIBS += -ljpeg -l$$LUANAME /usr/local/cspice/lib/cspice.a


This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
Celestia-developers mailing list