aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-02-03 22:12:50 +0100
committerThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-02-03 22:12:50 +0100
commit24dc4ff87241ecb5cf2266d75ea3b89fc4dff47d (patch)
tree5a72321c3956498c9f0d345123ca0d71826529f6 /setup.py
parentd97d12e781dde4101f45c15a3860b01aac2f2aca (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.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index b6ab9161c..42234fe5b 100644
--- a/setup.py
+++ b/setup.py
@@ -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: