diff options
author | Thomas-Karl Pietrowski <thopiekar@googlemail.com> | 2016-02-03 22:53:19 +0100 |
---|---|---|
committer | Thomas-Karl Pietrowski <thopiekar@googlemail.com> | 2016-02-03 22:53:19 +0100 |
commit | 933ead732e66f524b79099ce245b6906c0135c37 (patch) | |
tree | 8f9152834d500d3989e327709677af35ad926ee7 | |
parent | 24dc4ff87241ecb5cf2266d75ea3b89fc4dff47d (diff) |
Cleanup around qtinfo.py
* cleaning up unneeded redeclarations in setup.py
* making sure our "-qt=X" get passed to cmake (doesn't make any difference so far, but makes sense)
* rename getQMakePath to getQMakeCommand and make it return the complete command
-rw-r--r-- | qtinfo.py | 14 | ||||
-rw-r--r-- | setup.py | 21 |
2 files changed, 15 insertions, 20 deletions
@@ -9,13 +9,11 @@ class QtInfo(object): else: self._qmake_command = [find_executable("qmake"),] - def getQMakePath(self): - qmake_path = self._qmake_command[0] # Guessing the first of the commands is qmake - if not os.path.exists(qmake_path): # Making it here a bit more failsave. - qmake_path = find_executable(qmake_path) # In case someone just passed the name of the executable I'll search for it now. - if qmake_path == None: # If we couldn't resolv the location of the executable - raise ValueError("Could not find the location of %s. Please pass the absolute path to qmake or please pass the correct name of the executable." %(qmake_path)) - return qmake_path + def getQMakeCommand(self): + qmake_command_string = self._qmake_command[0] + for entry in self._qmake_command[1:]: + qmake_command_string += " %s" %(entry) + return qmake_command_string def getVersion(self): return self.getProperty("QT_VERSION") @@ -56,7 +54,7 @@ class QtInfo(object): bins_dir = property(getBinsPath) libs_dir = property(getLibsPath) plugins_dir = property(getPluginsPath) - qmake_command = property(getQMakePath) + qmake_command = property(getQMakeCommand) imports_dir = property(getImportsPath) translations_dir = property(getTranslationsPath) headers_dir = property(getHeadersPath) @@ -331,7 +331,6 @@ class pyside_build(_build): self.sources_dir = None self.build_dir = None self.install_dir = None - self.qmake_path = None self.py_executable = None self.py_include_dir = None self.py_library = None @@ -472,11 +471,11 @@ class pyside_build(_build): log.error("Failed to locate a dynamic Python library, using %s" % py_library) - qtinfo = QtInfo(QMAKE_COMMAND) + self.qtinfo = QtInfo(QMAKE_COMMAND) qt_dir = os.path.dirname(OPTION_QMAKE) - qt_version = qtinfo.version + qt_version = self.qtinfo.version if not qt_version: - log.error("Failed to query the Qt version with qmake %s" % qtinfo.qmake_path) + log.error("Failed to query the Qt version with qmake %s" % self.qtinfo.qmake_command) sys.exit(1) # Update the PATH environment variable @@ -504,13 +503,11 @@ class pyside_build(_build): self.sources_dir = sources_dir self.build_dir = build_dir self.install_dir = install_dir - self.qmake_path = OPTION_QMAKE self.py_executable = py_executable self.py_include_dir = py_include_dir self.py_library = py_library self.py_version = py_version self.build_type = build_type - self.qtinfo = qtinfo self.site_packages_dir = get_python_lib(1, 0, prefix=install_dir) self.build_tests = OPTION_BUILDTESTS @@ -535,11 +532,11 @@ class pyside_build(_build): log.info("Python prefix: %s" % py_prefix) log.info("Python scripts: %s" % py_scripts_dir) log.info("-" * 3) - log.info("Qt qmake: %s" % self.qmake_path) - log.info("Qt version: %s" % qtinfo.version) - log.info("Qt bins: %s" % qtinfo.bins_dir) - log.info("Qt docs: %s" % qtinfo.docs_dir) - log.info("Qt plugins: %s" % qtinfo.plugins_dir) + log.info("Qt qmake: %s" % self.qtinfo.qmake_command) + log.info("Qt version: %s" % self.qtinfo.version) + log.info("Qt bins: %s" % self.qtinfo.bins_dir) + log.info("Qt docs: %s" % self.qtinfo.docs_dir) + log.info("Qt plugins: %s" % self.qtinfo.plugins_dir) log.info("-" * 3) log.info("OpenSSL libs: %s" % OPTION_OPENSSL) log.info("=" * 30) @@ -614,7 +611,7 @@ class pyside_build(_build): cmake_cmd = [ OPTION_CMAKE, "-G", self.make_generator, - "-DQT_QMAKE_EXECUTABLE=%s" % self.qmake_path, + "-DQT_QMAKE_EXECUTABLE='%s'" % self.qtinfo.qmake_command, "-DBUILD_TESTS=%s" % self.build_tests, "-DDISABLE_DOCSTRINGS=True", "-DQt5Help_DIR=%s" % self.qtinfo.docs_dir, |