How Does One Put a Conditional For Embedded Linux into a .pro file?
Okay, in a .cpp file you can put the following:
#ifdef Q_WS_QWS
#endif
to denote Embedded Linux. It seems you can't do this in a .pro file. I've got a couple of lines in the .pro file that I want to ignore when compiling/running the application on the desktop (Linux). They are:
CONFIG += static
LIBS+= -L../xxxxkbrdplugin/kbddrivers \
-lxxxxkbrddriverplugin
How does one put a conditional in the .pro file to ignore these lines when compiling to run on a Linux desktop? Thanks for the help.
Re: How Does One Put a Conditional For Embedded Linux into a .pro file?
Hi,
you can use scopes with the name of the use makespec. Since I never have developed for embedded linux I don't know what is used but it is like:
Code:
linux-g++ {
# Linux stuff
}
macx-g++ {
# mac stuff
}
Re: How Does One Put a Conditional For Embedded Linux into a .pro file?
...or you can check your environment. E.g. you want to check if you are on a Mac-Darwin system:
Code:
SYSNAME = $$system(uname)
if (contains(SYSNAME, 'Darwin')) {
message("Yes, you are on a Darwin system!")
}
Re: How Does One Put a Conditional For Embedded Linux into a .pro file?
I went into the qt-everywhere-opensource-src-4.6.0/mkspecs/qws (Since I'm running on Embedded Linux) directory and chose the applicable mkspec. I then changed my .pro file to this:
linux-powerpc-g++ {
CONFIG += static
LIBS += -L../iviukbrdplugin/kbddrivers \
-liviukbrddriverplugin
}
Now I'm able to compile for the desktop and for the target without having to comment stuff out in the .pro file. Thanks Again!