qmake and QT_INSTALL_PREFIX. How can I select a new location for Qt library?

后端 未结 3 1996
猫巷女王i
猫巷女王i 2021-02-12 23:29

I am new to qmake and I am trying to build an existing application. Qt was originally installed in /usr/local/lib/Qt-4.3.5 and \'qmake -query QT_INSTALL_PREFIX\' returns that pa

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-13 00:11

    I was looking into this and found a way that works (in qt 4.7.2) by customizing qt with a qt.conf file.

    In my case, I added a qt4-4.7.2/bin/qt.conf (It must be in the same place as the qmake executable)

    With the following contents:

    [Paths]
    Prefix = c:/my_path/to/qt4-4.7.2
    

    and the qmake -query started returning the proper paths!

    See: http://doc.qt.io/qt-4.8/qt-conf.html for more details


    [Update:] Since at least Qt 5.3.1 (tested with static versions of 5.3.1 and 5.5 on Windows 8) you can simply do

    [Paths]
    Prefix = ..
    

    and deploy the Qt installation anywhere.

提交回复
热议问题