CMake doesn't know where is Qt4 qmake

后端 未结 8 1526
自闭症患者
自闭症患者 2021-02-04 00:05

I am using Debian OS and I\'m trying to point to cmake where is my Qt4.

I try to build qjson library and with its CMakeLists.txt: http://pastebin.com/fKNp0Qgy

I

8条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-04 00:28

    1) Where is your qtchooser configuration file?

      $: locate qtchooser | grep conf
    

    2) From the list of conf files, probably there is one call "default.conf" This one is a link to one of the others (4.conf or qt4.conf or 5.conf or qt5.conf). Choose the one that makes sense too you, and create a link to it.

    Suppose your default file path is

    /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

    Create backup:

      $: cd $(dirname /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf)
      $: cp -av default.conf default.conf_backup
    

    Let's say you target is /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf

    Then:

      $: sudo ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf default.conf
    

    3) Is the path to your qmake right?

    Check qmake location

      $: locate qmake | grep bin
    

    Is the same one as indicated in your modified qtchooser/default.conf?

      $: cat /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf
    

    If the answer is YES, then you are done. If the anser is no, then you need to modify the file:

    Create backup:

      $: cd $(dirname /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf)
      $: cp -av qt5.conf qt5.conf_backup
    

    Edit file and change path to your qmake location

      $ sudo vi qt5.conf
    

    Now it should be done.

提交回复
热议问题