Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2007
Qmake platform scopes


Message 1 in thread

Hi,
 
I was testing scopes in qmake under many platform and founds some inaccuracy
in the way they are for the moment.
 
My first found is that the mac scope is also a unix scope. It's logical in
fact, but it leads to error.
By doing the following trick you can achieve to get the result you want. It
would be best to provide a real scope for linux
 
unix:!macx:CONFIG += linux
 
#---------------------------------------------------------------------------
----
#---------------------------------------------------------------------------
----
win32:message( "Win platform" ){
    LIBS += -lpipo_win
}
 
#---------------------------------------------------------------------------
----
#---------------------------------------------------------------------------
----
macx:message( "Mac platform" ){
    LIBS  +=  -lpipo_mac
}
 
#---------------------------------------------------------------------------
----
#---------------------------------------------------------------------------
----
linux:message( "Linux platform" ){
    LIBS  += -lpipo_linux
}
 
Second found : support for 64 bits compilation. It seems that no real
solution exist for the moment.
I saw a trick for linux to check hardware before ( by using a classical
uname ), but in our case as we are using
vmware a lot, uname doesn't work. And in fact, it could fail, as we could do
cross compilation 32bits on a 64 kernel.
Same story for windows and for mac.
 
One solution is to do as the following : 
 
contains( QMAKE_CXXFLAGS, "-m64" ) {
     message( "Linux 64 bits" )
} else {
     message( "Linux 32 bits" )
}
 
But once again, this is not a definitive solution and not at all
cross-platform.
Does someone have a full set of rules for all plateform ? I would enjoy to
read the code.
 
Alexandre
 

Message 2 in thread

On 09.03.07 09:30:57, alexandre jenny wrote:
> Hi,
>  
> I was testing scopes in qmake under many platform and founds some inaccuracy
> in the way they are for the moment.
>  
> My first found is that the mac scope is also a unix scope. It's logical in
> fact, but it leads to error.
> By doing the following trick you can achieve to get the result you want. It
> would be best to provide a real scope for linux
...  
> Second found : support for 64 bits compilation. It seems that no real
> solution exist for the moment.
> I saw a trick for linux to check hardware before ( by using a classical
> uname ), but in our case as we are using
> vmware a lot, uname doesn't work. And in fact, it could fail, as we could do
> cross compilation 32bits on a 64 kernel.
> Same story for windows and for mac.

Did you check the Qt source code? They might be doing such things and
they surely know how to do it. Actually Qt sources use nearly every
feature the qmake offers, especially the undocumented ones ;)

Andreas

-- 
 [ signature omitted ] 

Message 3 in thread

"alexandre jenny" <alexandrejenny@xxxxxxxxx> wrote on 03/09/2007 01:30:57
AM:

# Second found : support for 64 bits compilation. It seems that no
# real solution exist for the moment.
# I saw a trick for linux to check hardware before ( by using a
# classical uname ), but in our case as we are using
# vmware a lot, uname doesn't work. And in fact, it could fail, as we
# could do cross compilation 32bits on a 64 kernel.

I've not done this personally, so YMMV... but I believe that the
correct way to do this is by setting QMAKESPEC:

32-bit compilation:
QMAKESPEC=linux-g++-32 qmake yada.pro

64-bit compilation:
QMAKESPEC=linux-g++-64 qmake yada.pro

Default for whatever you're sitting at:
QMAKESPEC=linux-g++ qmake yada.pro

Then (and I'm sure on this part) you test like this:

linux-g++* {
   message("Any Linux build")
}

*-g++-32 {
   message("Any 32-bit GCC build")
}

and so forth.

--
 [ signature omitted ] 

Message 4 in thread

Hi,

> I was testing scopes in qmake under many platform and founds some 
> inaccuracy in the way they are for the moment.
>  
> My first found is that the mac scope is also a unix scope. It's logical 
> in fact, but it leads to error.

Indeed, this has been discussed before. For example:
http://lists.trolltech.com/qt-interest/2005-02/thread00321-0.html

> By doing the following trick you can achieve to get the result you want. 
> It would be best to provide a real scope for linux
>  
> unix:!macx:CONFIG += linux

Not all Unix systems are Linux systems (not to mention that Linux is not 
Unix strictly speaking).

That said, there *is* a scope for Linux:
	linux-* {
	    ....
	}

> [...]
> win32:message( "Win platform" ){
> [...]
> macx:message( "Mac platform" ){
> [...]
> linux:message( "Linux platform" ){
> [...]

The world is not (entirely) limited to these three systems.

> Second found : support for 64 bits compilation. It seems that no real 
> solution exist for the moment.

What exactly do you mean by support for 64-bit compilation? Could you 
expand on your needs?

--
 [ signature omitted ]