Hi Bernard,

back from dinner, let me now run through a few tests of the few celestia.pro lines I sent earlier tonight.
Recall:

unix{   
    PREFIX = $$[PREFIX]
    isEmpty(PREFIX) { PREFIX=/usr/local }
    message ("PREFIX =" $$PREFIX)
....

I use the latest openSuSE 12.1 Linux with  Qt 4.8.1. Assume that I am in Celestia/build.
I start with an undefined PREFIX variable:

> qmake -unset PREFIX
> qmake -query PREFIX
**Unknown**

OK

then:
> qmake ../src/celestia.pro
Project MESSAGE: PREFIX = /usr/local

OK.

>qmake -set PREFIX /opt
> qmake -query PREFIX
/opt

> qmake ../src/celestia.pro
Project MESSAGE: PREFIX = /opt

OK!

and in the generated Makefile you see that the install directory is now indeed
-DCONFIG_DATA_DIR=\"/opt/share/celestia\"

Finally:

> qmake -unset PREFIX
> qmake -query PREFIX
**Unknown**

OK!

In summary: With these simple assignments in celestia.pro, everything works properly.

Next a few remarks concerning your previous patch for implementing some video capture.

Here I think we should implement a somewhat more sophisticated approach in celestia.pro that accounts for possible syntax differences of libraries in ALL popular Linux distros. For example, your patch fails for openSuSE, since there liblua5.1 would not be recognized. That's why we need to use pkg-config that is nicely supported in qmake.

unix {
    CONFIG += link_pkgconfig
   
    LUALIST = lua5.1 lua
    for(libpc, LUALIST):system(pkg-config --exists $${libpc}):LUAPC = $${libpc}
    isEmpty (LUAPC) {error("No shared Lua library found!")}

    PKGCONFIG += glu $$LUAPC libpng
    INCLUDEPATH += /usr/local/cspice/include
    LIBS += -ljpeg /usr/local/cspice/lib/cspice.a
   
}
As you can see, besides liblua I have similarly included glu.pc and libpng.pc. In my case it reads
-----------------------------------
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include/libpng14

Name: libpng
Description: Loads and saves PNG files
Version: 1.4.11
Libs: -L${libdir} -lpng14
Libs.private: -lz -lm
Cflags: -I${includedir}
-------------------------------------
and generally, also takes care of the include stuff!

Notably libpng has been recently updated and e.g. SuSE operates libpng12 and libpng14 in parallel.
Similarly for libGLU and libtheora, of course. Theora is supported via theora.pc in pkgconfig/.

If you haven't done it yet, please have a look into our extensive respective earlier discussions.  Some time ago, I have already committed our first version for eliminating the liblua ambiguities. For other libs the procedure is entirely analogous.

I'll present a respective update of celestia.pro very soon.

Fridger

PS: Of course Celestia also links against libpng etc. Some standard libs are predefined already via the mkspecs files in /usr/share/mkspecs.



 


On 04/14/2012 04:21 PM, Bernard GODARD wrote:
Hi all,

I have added a section on building the QT4 version of celestia on
Linux in http://en.wikibooks.org/w/index.php?title=Celestia/Development/Qt4

I have a few questions about the celestia.pro file:
1) the unix part does not link against libpng and zlib. Why is that?

2) How can I change the INSTALL PREFIX prefix to be /opt instead of
/usr/local without editing celestia.pro but using the QMAKE variable
PREFIX in celestia.pro. I tried the following:

astro@saturn:~/Dev/celestia/src$qmake -set PREFIX /opt
astro@saturn:~/Dev/celestia/src$qmake -query PREFIX
/opt
astro@saturn:~/Dev/celestia/src$cd ~/.config/Trolltech
astro@saturn:~/.config/Trolltech$ more QMake.conf
[2.01a]
PREFIX=/opt
astro@saturn:~/.config/Trolltech$ qmake -query
PREFIX:/opt
QT_INSTALL_PREFIX:/usr
QT_INSTALL_DATA:/usr/share/qt4
QT_INSTALL_DOCS:/usr/share/qt4/doc
QT_INSTALL_HEADERS:/usr/include/qt4
QT_INSTALL_LIBS:/usr/lib/x86_64-linux-gnu
QT_INSTALL_BINS:/usr/bin
QT_INSTALL_PLUGINS:/usr/lib/x86_64-linux-gnu/qt4/plugins
QT_INSTALL_IMPORTS:/usr/lib/qt4/imports
QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples
QT_INSTALL_DEMOS:/usr/lib/qt4/demos
QMAKE_MKSPECS:/usr/share/qt4/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.7.4
astro@saturn:~/.config/Trolltech$

but when running qmake on celestia.pro it still sees PREFIX as empty
and sets it to /usr/local.
Also I can't even unset the variable PREFIX without manually deleting
the file ~/.config/Trolltech/Qmake.conf. How do you do that? Is there
nothing like qmake -unset?

Thank you,

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Celestia-developers mailing list
Celestia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/celestia-developers