【问题标题】:CMake does not compíle Qt5 generate from buildrootCMake 不编译从 buildroot 生成的 Qt5
【发布时间】:2015-10-26 18:17:56
【问题描述】:

我使用 Buildroot 2014.05 使用 Qt5 生成了一个 tarball。 当我解压缩这些文件以使用 CMake 编译我的项目时,我收到以下错误消息:

      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 配置

<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

【问题讨论】:

    标签: cmake qt5 buildroot


    【解决方案1】:

    这部分:我使用 Buildroot 使用 Qt5 生成一个 tarball 确实很有意义。这到底是什么意思?

    如果您的意思是您压缩了@​​987654321@ 的内容(这是工具链和为您的目标构建应用程序所需的所有库),那么请注意它不可重定位。所以它必须安装在与生成它的位置相同的位置。所以现在,如果你想这样做,你应该将 BR2_HOST_DIR 配置选项设置为/opt/&lt;something&gt;/,然后将其压缩并解压缩它在您要使用工具链的其他机器上。

    在我们的 TODO 列表中可以重新定位它。

    【讨论】:

    • 抱歉误会,我使用 Buildroot 2014.05 生成文件 host.tar.bzip2 rootfs.tar.bz2 和 sysroot.tar.bz2,并在 /opt/ 下解压缩。
      我发现了我的问题,文件 Qt5CoreConfigExtras.cmake 有这个代码
      if (NOT TARGET Qt5::qmake) add_executable(Qt5::qmake IMPORTED) set(imported_location "/opt/")
      问题是这个 /opt/ 和我的 /opt/ 不同。
    猜你喜欢
    • 2014-11-10
    • 1970-01-01
    • 1970-01-01
    • 2014-02-23
    • 1970-01-01
    • 1970-01-01
    • 2017-04-29
    • 2021-09-06
    • 1970-01-01
    相关资源
    最近更新 更多