Qt5 app using GLESv2 fails to build against Yocto Application SDK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Qt5 app using GLESv2 fails to build against Yocto Application SDK

1,732 Views
brucebye
Contributor II

Hi,

I'm trying to use the Yocto BSP (dizzy) to create an application SDK that includes Qt5 - I'm using meta-qt5's meta-toolchain-qt5 recipe to do this.  I got to the point where a simple Qt5 app successfully compiles against the SDK produced, but I have another app which uses GLESv2 and for this qmake fails.

The issue appears to be that the Qt5GuiConfigExtras.cmake file generated has incorrect paths.  The initial error is that it's looking for the header file "GLES2/gl2.h" in "/usr/include/libdrm", rather than {path-to-target-sysroot}/usr/include.  There are also two calls to _qt5gui_find_extra_libs towards the end of the file which pass in the path of the original Yocto build environment rather than the extracted SDK.

I've worked around these post-install of the SDK by lifting code from Qt5LocationConfig.cmake to determine _qt5Gui_install_prefix and use that in the three places (and appending /include in addition to /include/libdrm where it is seeking gl2.h).  This allows qmake to succeed and the app builds.

However...I'd like to be able to generate an application SDK that doesn't need post-install patching in this way, and it's not obvious how the various variables relate to one another (and when they are acted on, in some cases) in Qt5GuiConfigExtras.cmake.in.  In particular, is there an error in the variables being set when qmake acts on gui.pro, a bug in the .cmake.in script, or both?

In case it's relevant, my target machine is imx6qsabreauto.

Thanks,

Bruce

0 Kudos
3 Replies

1,128 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Bruce,

Maybe this patch work for your case:

[oe] [meta-qt5][dizzy][PATCH] qmake5: don't always look in directories recursively

Regards

0 Kudos

1,128 Views
brucebye
Contributor II

That patch made no difference, unfortunately.  Here's the output from my cmake command.  CMakeError.log and CMakeOutput.log don't have anything that appears to be related to the failure to find gl2.h.  In particular, the last lines in CMakeError.log refer to the hunt for pthreads, which appears to eventually succeed.

CMAKE_PREFIX_PATH="$SDKTARGETSYSROOT/usr/lib/cmake" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake.d/OEQt5Toolchain.cmake" ../src

-- The C compiler identification is GNU 4.9.1

-- The CXX compiler identification is GNU 4.9.1

-- Check for working C compiler: /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc

-- Check for working C compiler: /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++

-- Check for working CXX compiler: /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Building Demo Viewer version 1.0.0.0 using build type 'Release'.

--     Source directory is '/home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/src'.

--     Build directory is '/home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/build'.

-- Looking for include file pthread.h

-- Looking for include file pthread.h - found

-- Looking for pthread_create

-- Looking for pthread_create - not found

-- Looking for pthread_create in pthreads

-- Looking for pthread_create in pthreads - not found

-- Looking for pthread_create in pthread

-- Looking for pthread_create in pthread - found

-- Found Threads: TRUE 

CMake Error at /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:10 (message):

  Failed to find "GLES2/gl2.h" in "/usr/include/libdrm".

Call Stack (most recent call first):

  /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:158 (include)

  /home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/poky/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/cmake/Qt5Quick/Qt5QuickConfig.cmake:100 (find_package)

  CMakeLists.txt:84 (find_package)

-- Configuring incomplete, errors occurred!

See also "/home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/build/CMakeFiles/CMakeOutput.log".

See also "/home/jenkins/slave-root/workspace/Dev-Demo-Viewer-Yocto/build/CMakeFiles/CMakeError.log".

0 Kudos

1,128 Views
brucebye
Contributor II

Thanks for the suggestion.  I'm not sure whether it will help, as the patch looks only tangentially related to my issue.  However...I will give it a go and let you know.

Bruce

0 Kudos