1

I generate a tarball with Qt5 using Buildroot 2014.05. When I uncompressed this files to compile my project using CMake I receive the following error message:

      CMake Error at <project> /sysroot/usr/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
  The imported target "Qt5::Core" references the file

     "<project>/host/usr/bin/qmake"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/<project>/sysroot/usr/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake"

  but not all the files it references.

I'm using the cmake configs under

<project>/sysroot/usr/lib/cmake/

and my CMakeLists.txt

set(CMAKE_PREFIX_PATH <project>/sysroot/usr/lib/cmake/QtWidgets/ )
find_package(Qt5Widgets REQUIRED)

Any suggestion?


Buildroot 2014.05 does not have qmake to install

user3142
  • 799
  • 3
  • 9
  • 14

1 Answers1

1

This part: I generate a tarball with Qt5 using Buildroot does make much sense. What do you mean exactly by this ?

If by this you mean that you tarball'ed the contents of output/host/ (which is the toolchain and all the libraries that you need to build applications for your target), then beware that it is not relocatable. So it has to be installed in the same location as the one it was generated in. So for now, if you want to do this, you should set the BR2_HOST_DIR configuration option to something like /opt/<something>/, and then tarball that up and uncompress it on the other machines where you want to use the toolchain.

It's in our TODO-list to make this relocatable.

Thomas Petazzoni
  • 5,636
  • 17
  • 25
  • Sorry for the misunderstanding, I generate the files host.tar.bzip2 rootfs.tar.bz2 and sysroot.tar.bz2 with Buildroot 2014.05 and it's uncompress under /opt/.
    I found my problem, the file Qt5CoreConfigExtras.cmake has this code
    if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) set(imported_location "/opt/")
    The problem is that this /opt/ is different from my /opt/.
    – user3142 Oct 27 '15 at 18:24