diff options
author | Thomas-Karl Pietrowski <thopiekar@googlemail.com> | 2016-02-03 22:12:50 +0100 |
---|---|---|
committer | Thomas-Karl Pietrowski <thopiekar@googlemail.com> | 2016-02-03 22:12:50 +0100 |
commit | 24dc4ff87241ecb5cf2266d75ea3b89fc4dff47d (patch) | |
tree | 5a72321c3956498c9f0d345123ca0d71826529f6 /setup.py | |
parent | d97d12e781dde4101f45c15a3860b01aac2f2aca (diff) |
Adding -qt=X option only if qmake is a link to qtchooser
On Linux (at least on Ubuntu and Debian) qtchooser is used to switch between different installations of Qt.
A user reported that on Windows this method does not (seem) exist.
Don't know whether his/her Qt5 setup was correct or not, but this commit adds a check, which
* Looks whether qmake exists at all
* Checks whether it is a symlink
* Checks whether the symlink is pointing at a existing file
* And check whether this file is qtchooser.
It doesn't matter if the link is called "/usr/bin/qtchooser" or "qtchooser" and we only add "-qt=X" in these cases.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -168,6 +168,15 @@ if OPTION_QMAKE is None: OPTION_QMAKE = find_executable("qmake-qt5") if OPTION_QMAKE is None: OPTION_QMAKE = find_executable("qmake") + +QMAKE_COMMAND = None +if os.path.exists(OPTION_QMAKE): # Checking whether qmake executable exists + if os.path.islink(OPTION_QMAKE) and os.path.lexists(OPTION_QMAKE): # Looking whether qmake path is a link and whether the link exists + if "qtchooser" in os.readlink(OPTION_QMAKE): # Set -qt=X here. + QMAKE_COMMAND = [OPTION_QMAKE, "-qt=%s" %(OPTION_QT_VERSION)] +if not QMAKE_COMMAND: + QMAKE_COMMAND = [OPTION_QMAKE] + if OPTION_CMAKE is None: OPTION_CMAKE = find_executable("cmake") @@ -463,7 +472,7 @@ class pyside_build(_build): log.error("Failed to locate a dynamic Python library, using %s" % py_library) - qtinfo = QtInfo([OPTION_QMAKE, "-qt=%s" %(OPTION_QT_VERSION)]) + qtinfo = QtInfo(QMAKE_COMMAND) qt_dir = os.path.dirname(OPTION_QMAKE) qt_version = qtinfo.version if not qt_version: |