0

Trying to cross compile QT app. After inherit qt5 stuffs in SDK and exporting environment, I am able to build application successfully by invoking cmake and make command manually on the terminal. But I am not able to build the same application by running provided below script:

src/example-App$./app-qt5-build.sh

It throws error:

Could not find a package configuration file provided by "Qt5" with any of
the following names:

    Qt5Config.cmake
    qt5-config.cmake

Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files.  If "Qt5" provides a
separate development package or SDK, be sure it has been installed.

app-qt5-build.sh:

#!/bin/bash

source sdk/environment-setup-cortexa9hf-neon-linux-gnueabi
TargetPath="/sdk/sysroots/zc702-zynq-linux/"

if [ -d build ] ; then
    rm -rf build
fi


mkdir build && pushd build

export TargetPath

cmake -G "Unix Makefiles" ..

make -j 4

popd

What is going wrong with this script? Could you provide me some hints on this?

Manually cmake command builds successfully.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
SK17
  • 182
  • 4
  • 15
  • "Could you provide me some hints on this?" - Probably, some of your environment variable tells CMake about QT installation directory. But script doesn't set this variable. Most likely the variable are set in script `sdk/environment-setup-cortexa9hf-neon-linux-gnueabi` script, so you need to inspect it for debugging your problem. – Tsyvarev Jun 16 '20 at 10:09
  • Open a new terminal, then type the commands that work, then copy-paste them into the question, then we can see what you're doing differently. I'm not sure what is supposed to consume the `TargetPath` env variable... can you point (using your index finger) to a place in cmake code that consumes this? – Kuba hasn't forgotten Monica Jun 17 '20 at 00:11

0 Answers0