2015-10-26 223 views
1

我使用Buildroot 2014.05生成包含Qt5的tarball。 当我解压缩文件的这个使用CMake的我收到以下错误消息编译我的项目:CMake不包含从buildroot生成的Qt5

 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. 

我使用CMake的CONFIGS下

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

和我的CMakeLists.txt

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

有什么建议吗?


Buildroot里面2014.05不必QMAKE安装

回答

1

这一部分:我生成使用Buildroot里面没有多大意义与QT5一个压缩包。这是什么意思?

如果你这样做,你的意思是你打包了output/host/(这是工具链和你需要为你的目标构建应用程序所需的所有库)的内容,然后注意它不可重定位。因此,它必须安装在与生成的位置相同的位置。因此,现在,如果要这样做,则应该将BR2_HOST_DIR配置选项设置为/opt/<something>/之类的内容,然后对其进行压缩并将其解压缩您想使用工具链的其他机器。

这是在我们的待办事项列表中,使其可重新定位。

+0

对不起,我使用Buildroot 2014.05生成了文件host.tar.bzip2 rootfs.tar.bz2和sysroot.tar.bz2,它在/ opt/下解压缩。
我发现我的问题,将文件Qt5CoreConfigExtras.cmake有这个代码
如果(NOT TARGET QT5 :: QMAKE) add_executable(QT5 :: QMAKE原装进口) 集(imported_location “的/ opt/”)
的问题是,这/ opt/与我的/ opt/不同。 – user3142