aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2017-11-21 13:30:07 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-05 15:48:53 +0000
commitfbb90fbf357f5632b3c87c8766e6d56c48f6a45a (patch)
tree2195b8058012a62d99d31d57ffd348bd88ef0013 /setup.py
parent88ab82b283fcb7e5805819ea18dc8d22b035b7bf (diff)
setup.py: Ensure that the Qt source path is correct
- Add the -qt-src-dir option - Set qtSrcDir variable only if the -qt-src-dir option is None (auto-detect SDKs and in-source builds) Task-number: PYSIDE-363 Change-Id: Iac63c5b4fde0c9f6769ae4fc7e0e899e8bf84b76 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 092dac4c1..95ff876d8 100644
--- a/setup.py
+++ b/setup.py
@@ -260,6 +260,7 @@ OPTION_SKIP_PACKAGING = has_option("skip-packaging")
OPTION_MODULE_SUBSET = option_value("module-subset")
OPTION_RPATH_VALUES = option_value("rpath")
OPTION_QT_CONF_PREFIX = option_value("qt-conf-prefix")
+OPTION_QT_SRC = option_value("qt-src-dir")
if OPTION_QT_VERSION is None:
OPTION_QT_VERSION = "5"
@@ -442,10 +443,15 @@ def prepareBuild():
pkg_dir = os.path.join(script_dir, pkg)
os.makedirs(pkg_dir)
# locate Qt sources for the documentation
- qmakeOutput = run_process_output([OPTION_QMAKE, '-query', 'QT_INSTALL_PREFIX/src'])
- if qmakeOutput:
- global qtSrcDir
- qtSrcDir = qmakeOutput[0].rstrip()
+ if OPTION_QT_SRC is None:
+ qmakeOutput = run_process_output([OPTION_QMAKE, '-query', 'QT_INSTALL_PREFIX'])
+ if qmakeOutput:
+ global qtSrcDir
+ installPrefix = qmakeOutput[0].rstrip()
+ if installPrefix.endswith("qtbase"): # In-source, developer build
+ qtSrcDir = installPrefix
+ else: # SDK: Use 'Src' directory
+ qtSrcDir = os.path.join(os.path.dirname(installPrefix), 'Src', 'qtbase')
class pyside_install(_install):
def _init(self, *args, **kwargs):
@@ -890,8 +896,10 @@ class pyside_build(_build):
moduleSubSet += m
cmake_cmd.append("-DMODULES=%s" % moduleSubSet)
# Add source location for generating documentation
- if qtSrcDir:
- cmake_cmd.append("-DQT_SRC_DIR=%s" % qtSrcDir)
+ cmake_src_dir = OPTION_QT_SRC if OPTION_QT_SRC else qtSrcDir
+ cmake_cmd.append("-DQT_SRC_DIR=%s" % cmake_src_dir)
+ log.info("Qt Source dir: %s" % cmake_src_dir)
+
if self.build_type.lower() == 'debug':
cmake_cmd.append("-DPYTHON_DEBUG_LIBRARY=%s" % self.py_library)