Nominate our 2022 Qt Champions!

[solved] How to build plugins like... tslib

  • So, first off, I know you can go in and manually build it, but for our embedded platform thats a very very messy solution. I've been looking to try and find out a way to configure and build tslib with the rest of Qt5.

    For our build system, it uses a linux kernel like make/menuconfig. I don't know how to add extra steps based on which system drivers are getting installed like evdev, tslib, or x11 so I'm trying to figure out how to add in to lets sate ./configure or even extra make targets?

    Finally found the edit button!

  • Lifetime Qt Champion


    There's something not really clear. Do you want to add options when configuring Qt 5 based on what you configured with your build system ? Or do you want to integrate the configure/build phases of Qt 5 in your build system ?

  • So I looked into qt5 a bit more and configuring it for tslib, it appears to not be possible at all.

    in the generic folder the .pro file doesn't have a config option to include tslib, so i had to make a make project just to go in, build and install it separately. Other then some pathing issues, which is likely a mistake with the make file, everything works fine!

  • Lifetime Qt Champion

    You might succeed integrating tslib but you would have to do the same work as for e.g. libtiff meaning, adapt the compilation process so qmake can be used.

    Anyway, great you succeeded !

    Don't forget to update the thread title to solved so other forum members may know a solution has been found :)

  • i'm not really sure how to mark the thread as solved, I don't seem to have an option

  • Lifetime Qt Champion

    Just edit your first post and modify the title, that's all :)

  • oh, that seems simple. Well before i do that i ran into another problem with INSTALL_ROOT

    when i run make INSTALL_ROOT=path install in the directory it seems that there is some extra target that i'm not seeing

    @cd /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/qt5-5.0.2/qt-everywhere-opensource-src-"5.0.2"/qtbase/src/plugins/generic/tslib/ &&
    fakeroot -- make -j4 INSTALL_ROOT=/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install install @

    AFter running the make command from the make file i made it seems to have the correct INSTALL_ROOT

    make[1]: Entering directory /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/qt5-5.0.2/qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins/generic/tslib' install -m 755 -p "../../../../plugins/generic/" "/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/share/plugins/generic/" strip --strip-unneeded "/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/share/plugins/generic/" make[1]: Leaving directory/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/qt5-5.0.2/qt-everywhere-opensource-src-5.0.2/qtbase/src/plugins/generic/tslib'
    cd /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install && PATH=/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/fake/bin:/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/ccache:/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/bin:/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/usr/bin:/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/sbin:/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/usr/sbin:/usr/bin:/bin fakeroot -- /bin/bash -c "if [ -f /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install/ ]; then /bin/bash /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install/; rm /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin_install/; fi; /bin/tar czf /media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/packages/qt5tslibplugin-5.0.2-armv7l-timesys-linux-gnueabi-1.tgz ."

    when it steps into the install it seems to have put two roots together and I'm not sure where the second string came from


    the correct path should be

  • i think it has something to do with the qt_plugin.prf

    here is the install line in the generated MAKEFILE
    @@test -d $(INSTALL_ROOT)/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/share/plugins/generic || mkdir -p $(INSTALL_ROOT)/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/share/plugins/generic@
    this seems like it would make it difficult to install or package plugins, is this supposed to happen?

  • Lifetime Qt Champion

    I am not following you. What are you trying to do now ?

  • I'm trying to install it into the staging directory for the root file system, there are two problems doing so.

    Since you can't configure tslib any more, it has to be built separately, so it doesn't get packaged or installed with Qt in our LTIB like system.

    Having a second make file to build and install tslib kind of works except that it hard codes the path to the wrong Qt path. So when you go to install or package it using

    @make INSTALL_ROOT=$(DESTDIR) install@

    Its incorrect, our make file looked like this

    ./stamp_packaged: DESTDIR=path/to/staging/package
    ./stamp_rfs_installed: DESTDIR=path/to/staging/rfs
    ./stamp_host_toolchain_installed: DESTDIR=path/to/staging/toolchain

    ./stamp_packaged ./stamp_rfs_installed ./stamp_host_toolchain_installed:
    cd $(qt5_DDR) &&
    make INSTALL_ROOT=$(DESTDIR) install

    since tslib hard codes the path in the Makefile after running qmake in the tslib dir instead of using the relative path the install make target is completely broken.

    this is what it ends up being so, instead of correctly using the relative path it uses the both paths put together.
    @$(INSTALL_ROOT)/media/Work/Factory/factory-base/build_armv7l-timesys-linux-gnueabi/toolchain/share/plugins/generic @

    it should be $(INSTALL_ROOT)/share/plugins/generic for make install to work correctly.

  • Lifetime Qt Champion

    Just thinking of something. What do you use to build your device root file system content ?

  • Its a modified ltib from timesys.

    Unfortunately now that i have everything building properly we had to take qt5 out since opengl doesn't work on our prototype board... awesome.

  • Lifetime Qt Champion

    Do you mean the driver for your boards doesn't do OpenGL ?

    Anyway, you can build Qt 5 without OpenGL and use e.g. the LinuxFB plugin

  • It does open gl but the driver is broken because of changes we made, I have to go figure that out,

    And Don't you need OpenGL for QML and QtQuick

  • Lifetime Qt Champion

    IIRC, QtQuick 1 doesn't but QtQuick 2 does, it can however make use the MESA library which provides OpenGL on unaccelerated hardware but the performance won't be as good.

    So indeed, fixing the driver would be best

  • Well, i'd love to try it but we've literally got 3 weeks to get everything running on the device ;/.

    I also noticed qt 5.1.1 has tslib configurable again so when i do move to qt5 i'll make sure to use at least that version

  • Lifetime Qt Champion

    That might be short indeed

  • [quote author="SavageTwinky" date="1382120309"]So I looked into qt5 a bit more and configuring it for tslib, it appears to not be possible at all.

    in the generic folder the .pro file doesn't have a config option to include tslib, so i had to make a make project just to go in, build and install it separately. Other then some pathing issues, which is likely a mistake with the make file, everything works fine![/quote]

    Dear SavageTwinky,

    You mean to say that you manually went inside the tslib folder and then gave make. After this gets generated inside plugins/generic folder.

    Now i want to ask how you used the above library with
    I mean to say you wrote anything extra in the QT program code so that plugin is called?
    Kindly guide me.

Log in to reply