使用 QT 和 cmake 为 uCLinux 编译 musescore

发布于 2025-01-07 21:42:43 字数 3257 浏览 0 评论 0原文

我尝试了一些方法,但在尝试为 blackfin 进行 cmake 时仍然遇到此错误:

CMake Error at CMakeLists.txt:116 (message):

  Fatal error: QT (version >= 4.5.0) required.  Cmake tries to detect QT4 by

  searching for 'qmake' in your PATH.If you have QT4 installed, make sure

  qmake is found in your PATH.  If you compiled QT4 yourself make sure your

  new qmake ist found _first_ in your PATH.

我正在尝试编译 musescore 0.9.5 的源代码,以使其与 uClinux 选项中现有的 QT 版本兼容

我所做的是使用 QT lib 编译 uClinux 内核,这样我就可以拥有合适的嵌入式 QT。

然后我修改了 musescore 的 Makefile 以使用 uclinux 编译器进行构建。我尝试过不同的事情,所以我在这里展示最新的试验:

bfin:

        mkdir build;

        mkdir install;                               \

        cd build;

        cmake -DCMAKE_TOOLCHAIN_FILE=bfin.cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -\

DQT_QMAKE_EXECUTABLE=/home/william/Development_new/Music_Recognition/code/uCLin\

ux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-sr\

c-4.5.1/bin         -libdir=/home/william/Development_new/Music_Recognition/cod\

e/uCLinux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-openso\

urce-src-4.5.1/lib    \
                -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
                mscore;

在 CMakeLists.txt 中我确实添加了:

link_directories(/home/william/Development_new/Music_Recognition/code/uCLinux/r\

ev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.\

5.1/bin)



SET(CMAKE_MODULE_PATH /home/william/Development_new/Music_Recognition/code/uCLi\

nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\

rc-4.5.1/bin)



SET(CMAKE_PREFIX_PATH /home/william/Development_new/Music_Recognition/code/uCLi\

nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\

rc-4.5.1/bin)



SET(QT_QMAKE_EXECUTABLE /home/william/Development_new/Music_Recognition/code/uC\

Linux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource\

-src-4.5.1/bin)

我的 bfin.cmake 看起来像这样:

# this one is important                                                     

SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much                                                       

SET(CMAKE_SYSTEM_VERSION 1)


#                                                                           

SET (BFIN "/opt/uClinux/bfin-uclinux")


# specify the cross compiler                                                
SET(CMAKE_C_COMPILER    ${BFIN}/bin/bfin-uclinux-gcc)

SET(CMAKE_CXX_COMPILER   ${BFIN}/bin/bfin-uclinux-g++)
SET(CMAKE_LINKER        ${BFIN}/bin/bfin-uclinux-ld)


#/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib                     

LINK_DIRECTORIES("${BFIN}/usr/lib")



SET(CMAKE_FIND_ROOT_PATH

  /opt/uClinux/bfin-uclinux/bfin-uclinux

  /opt/uClinux/bfin-linux-uclibc

  /opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime)


# search for programs in the build host directories                         

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories                       

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

提前感谢您的帮助,

William

I've try few things but I still have this error when trying to cmake for blackfin:

CMake Error at CMakeLists.txt:116 (message):

  Fatal error: QT (version >= 4.5.0) required.  Cmake tries to detect QT4 by

  searching for 'qmake' in your PATH.If you have QT4 installed, make sure

  qmake is found in your PATH.  If you compiled QT4 yourself make sure your

  new qmake ist found _first_ in your PATH.

I'm trying to compile the source of musescore 0.9.5 to keep it compatible with the existing version of QT in uClinux options

What I did is to compile the uClinux kernel with QT lib so I can have the suitable embedded QT.

then I modified the Makefile of musescore to build with uclinux compilers. I've try different things so I show here the latest trial:

bfin:

        mkdir build;

        mkdir install;                               \

        cd build;

        cmake -DCMAKE_TOOLCHAIN_FILE=bfin.cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -\

DQT_QMAKE_EXECUTABLE=/home/william/Development_new/Music_Recognition/code/uCLin\

ux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-sr\

c-4.5.1/bin         -libdir=/home/william/Development_new/Music_Recognition/cod\

e/uCLinux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-openso\

urce-src-4.5.1/lib    \
                -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
                mscore;

in the CMakeLists.txt I did add:

link_directories(/home/william/Development_new/Music_Recognition/code/uCLinux/r\

ev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.\

5.1/bin)



SET(CMAKE_MODULE_PATH /home/william/Development_new/Music_Recognition/code/uCLi\

nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\

rc-4.5.1/bin)



SET(CMAKE_PREFIX_PATH /home/william/Development_new/Music_Recognition/code/uCLi\

nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\

rc-4.5.1/bin)



SET(QT_QMAKE_EXECUTABLE /home/william/Development_new/Music_Recognition/code/uC\

Linux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource\

-src-4.5.1/bin)

my bfin.cmake look like that:

# this one is important                                                     

SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much                                                       

SET(CMAKE_SYSTEM_VERSION 1)


#                                                                           

SET (BFIN "/opt/uClinux/bfin-uclinux")


# specify the cross compiler                                                
SET(CMAKE_C_COMPILER    ${BFIN}/bin/bfin-uclinux-gcc)

SET(CMAKE_CXX_COMPILER   ${BFIN}/bin/bfin-uclinux-g++)
SET(CMAKE_LINKER        ${BFIN}/bin/bfin-uclinux-ld)


#/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib                     

LINK_DIRECTORIES("${BFIN}/usr/lib")



SET(CMAKE_FIND_ROOT_PATH

  /opt/uClinux/bfin-uclinux/bfin-uclinux

  /opt/uClinux/bfin-linux-uclibc

  /opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime)


# search for programs in the build host directories                         

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories                       

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Thanks in advance for the help,

William

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紅太極 2025-01-14 21:42:43

您需要将 qmake 放入您的 $PATH 中。如果您更喜欢使用 QT_QMAKE_EXECUTABLE,它必须指向实际的 qmake 二进制文件而不是目录。

话虽这么说,MuseScore 0.9.5 是 MuseScore 的一个非常非常老的版本,当前版本是 1.1,1.2 即将推出。查看 http://musescore.org 了解有关 MuseScore 的更多信息,并随时通过 freenode 上的#musescore 联系开发人员.net 或开发者邮件列表 http://musescore.org/mailing-list

You need to put qmake in your $PATH. If you prefer to use QT_QMAKE_EXECUTABLE it has to point to the actual qmake binary and not the directory.

That being said, MuseScore 0.9.5 is a very very old version of MuseScore, the current version is 1.1 and 1.2 is coming soon. Check http://musescore.org for more information about MuseScore and don't hesitate to contact the developers on #musescore on freenode.net or on the developer mailing list at http://musescore.org/mailing-list

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文