[Original problem solved] Using different tool chains in creator
-
Thanks for answer.
I am working with creator 2.2.0. The platform is Ubuntu. I want compile for debugging on the host and also do cross-compilation.
I have switched the build configuration under Projects->Build settings , but does not seem to different from Ctrl-T.
Under MSVC you can simply change from debug to release and press build. So I hoped that it may be similar with the creator. -
Hmmm... Ctrl-T, Tab, arrow up/down, to switch the build configuration, ESC to close the dialog and Ctrl-B to trigger the build. Seems acceptable to me:-)
-
Oh, your application consists of several distinct parts?
Why don't you write a pro-file to bind them all together? The subdirs template works fine for that:-)
-
ok?
First, yes, the application has several distinct parts. Respectively, I have a couple of applications sharing the same libs. The pressing problem is at the time for one application only. But certainly, it is good to a more general solution.
Can you give me a hint on specific doc with an example? -
[quote author="Tobias Hunger" date="1306785408"]Hmmm... Ctrl-T, Tab, arrow up/down, to switch the build configuration, ESC to close the dialog and Ctrl-B to trigger the build. Seems acceptable to me:-)[/quote]
Very good... from now it will be my building procedure too. :-Dkoahnig,
if I undertood what you need you should do this in your .pro:
@
...
...
linux-g++ {
#queste 4 righe seguenti servono per qextserialport:
INCLUDEPATH += ../qextserialport_x86
QMAKE_LIBDIR += ../qextserialport_x86/build
LIBS += -lqextserialport
DEFINES = TTY_POSIX
}linux-arm-gnueabi-g++ {
#queste 4 righe seguenti servono per qextserialport:
INCLUDEPATH += ../qextserialport_beagle
QMAKE_LIBDIR += ../qextserialport_beagle/build
LIBS += -lqextserialport
DEFINES = TTY_POSIX
}
@I use this to compile for my linux pc and to cross-compile for my beagleboard using qextserialport library.
Remember that before this you need to compile the library for both platform and put it in different directories .
-
Luca, thanks for info.
I will try it. With a little trial and error I ended with something like:
@
...
...
Host: INCLUDEPATH += ../qextserialport_x86
Arm: INCLUDEPATH += ../qextserialport_beagle
Host: QMAKE_LIBDIR += ../qextserialport_x86/build
Arm: QMAKE_LIBDIR += ../qextserialport_beagle/build
Host: LIBS += -lqextserialport
Arm: LIBS += -lqextserialport
DEFINES = TTY_POSIX
@
which could be rewritten as:
@
...
...
Host {
INCLUDEPATH += ../qextserialport_x86
QMAKE_LIBDIR += ../qextserialport_x86/build
LIBS += -lqextserialport
}
Arm {
INCLUDEPATH += ../qextserialport_beagle
QMAKE_LIBDIR += ../qextserialport_beagle/build
LIBS += -lqextserialport
}
DEFINES = TTY_POSIX
@Arm or Host is set through the parameter list with "CONFIG+=Arm" for instance. I knew that it is a little wooden, but it worked and elegance was not my major target.
Now following your example, I may simplify also other steps, but I am not clear how to know the parameter "linux-arm-gnueabi-g++" or the slightly different version I probably need.
Is it one of the commands in *.conf?
Or is it the directory name where the conf is stored?BTW I have generated a Qt version for cross compilation and that part is working. I have copied and adjusted for compiler path names a directory in "mkspecs/qws".
-
[quote author="koahnig" date="1306839404"] I am not clear how to know the parameter "linux-arm-gnueabi-g++" or the slightly different version I probably need.
[/quote]
To know it you must enter your Qt source (mine is in /opt/qt4-4.7.1 and /opt/qt4-4.7.1-beagle) and type:
@
ls -l /opt/qt4-4.7.1/mkspecs/default
@
it's a symbolic link. I get this:
@
lrwxrwxrwx 1 root root 9 Dec 16 21:03 /opt/qt4-4.7.1/mkspecs/default -> linux-g++
@
so I must use linux-g++ when compiling for my linux PC.While for my beagleboard (arm) :
@
ls -l /opt/qt4-4.7.1-beagle/mkspecs/default
@
I get:
@
/opt/qt4-4.7.1-beagle/mkspecs/default -> qws/linux-arm-gnueabi-g++/
@So I must use "linux-arm-gnueabi-g++" .
That's all .
Let me know...
-
Yes, this does work.
The names you are determining through the symbolic link are the same as used for the -spec parameter used by creator for qmake.Currently, I am struggling with the CONFIG parameter. I assumed that it contains either "debug" or "release". In creator you have the choices between "Debug", "Release" and "Debug and release".
I have added following statement to the .pro file:
@
message ("CONFIG = " $$CONFIG)
@For debug the output is:
@
Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework debug Arm staticlib
@For release the output is:
@
Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework Arm staticlib
@For "Debug and release" the output is:
@
Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources debug DebugBuild Debug build_pass qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework debug_and_release Arm debug DebugBuild Debug build_pass staticlib
@in qmake doc for "CONFIG":http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#config
you can read that "relase" is ignored when "debug" is present. But the release and debug settings are containing both.Am I compiling the whole time in debug mode even when switched to release?
I understand where the last (two/three) parameters in each CONFIG are coming from, but not the majority in the beginning.
-
The original problem is solved through the subdirs template of qmake.
Here is the example of my case
@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS =
ALib
BLib
CLib
DLib
Applications/Appl1
@Each directory needs a .pro-file with the same name as the directory name is.