aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-10-13 12:34:16 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-10-14 14:01:35 +0000
commit52f4ed0829bf8a47ad3cc16d7679d31ae645f17b (patch)
tree206abc2ab0c6ed178969d8a1098469a49afb79e0 /setup.py
parent6a77fbf65cf4f22c116a107ae22830b1a725913c (diff)
setup: Add QT_SRC_DIR variable
Presence of the variable enables the generation of the doc targets in PySide2. Task-number: PYSIDE-363 Change-Id: I0e1d4702da297f2390f09f9354c413da24febee1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 2bd0be350..722710edb 100644
--- a/setup.py
+++ b/setup.py
@@ -197,6 +197,8 @@ def check_allowed_python_version():
check_allowed_python_version()
+qtSrcDir = ''
+
# Declare options
OPTION_DEBUG = has_option("debug")
OPTION_RELWITHDEBINFO = has_option('relwithdebinfo')
@@ -392,6 +394,11 @@ def prepareBuild():
for pkg in ["pyside_package/PySide2", "pyside_package/pyside2uic"]:
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()
class pyside_install(_install):
def _init(self, *args, **kwargs):
@@ -756,6 +763,9 @@ class pyside_build(_build):
cmake_cmd.append("-DPYTHON_EXECUTABLE=%s" % self.py_executable)
cmake_cmd.append("-DPYTHON_INCLUDE_DIR=%s" % self.py_include_dir)
cmake_cmd.append("-DPYTHON_LIBRARY=%s" % self.py_library)
+ # Add source location for generating documentation
+ if qtSrcDir:
+ cmake_cmd.append("-DQT_SRC_DIR=%s" % qtSrcDir)
if self.build_type.lower() == 'debug':
cmake_cmd.append("-DPYTHON_DEBUG_LIBRARY=%s" % self.py_library)