2015-10-26 224 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