aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-04-06 20:29:21 +0200
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-04-07 17:28:11 +0200
commit34b0fb6008db7328ced1e16885aec9cf58cad2c8 (patch)
tree07cdc5eee18032612960e13c92ebfc0e7ff0eb3d
parent8bf8b4bd5a760c2089faeac00491dddcda2681ab (diff)
doc: make sure '--skip-docs' skip the docs
Even when using the code, some portions of the cmake file in sources/pyside6/doc/ was still being executed. This makes sure everything is skipped if we use the '--skip-docs' option when building. Change-Id: If78b19b9650b61b642e447b8c96b814e82994d7c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit fbbae556c9bf060be366fd578986cae85ff8caec) Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--build_scripts/main.py22
-rw-r--r--sources/pyside6/CMakeLists.txt2
2 files changed, 15 insertions, 9 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 1d79621c8..9e0a6b0d6 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -759,6 +759,8 @@ class PysideBuild(_build, DistUtilsCommandMixin):
# Add source location for generating documentation
cmake_src_dir = OPTION["QT_SRC"] if OPTION["QT_SRC"] else qt_src_dir
cmake_cmd.append(f"-DQT_SRC_DIR={cmake_src_dir}")
+ if OPTION['SKIP_DOCS']:
+ cmake_cmd.append("-DSKIP_DOCS=yes")
log.info(f"Qt Source dir: {cmake_src_dir}")
if self.build_type.lower() == 'debug':
@@ -854,15 +856,18 @@ class PysideBuild(_build, DistUtilsCommandMixin):
cmake_cmd.append("-DCMAKE_C_COMPILER=cl.exe")
cmake_cmd.append("-DCMAKE_CXX_COMPILER=cl.exe")
- if OPTION["DOC_BUILD_ONLINE"]:
- log.info("Output format will be HTML")
- cmake_cmd.append("-DDOC_OUTPUT_FORMAT=html")
- else:
- log.info("Output format will be qthelp")
- cmake_cmd.append("-DDOC_OUTPUT_FORMAT=qthelp")
+ if not OPTION["SKIP_DOCS"]:
+ # Build the whole documentation (rst + API) by default
+ cmake_cmd.append("-DFULLDOCSBUILD=1")
- # Build the whole documentation (rst + API) by default
- cmake_cmd.append("-DFULLDOCSBUILD=1")
+ if OPTION["DOC_BUILD_ONLINE"]:
+ log.info("Output format will be HTML")
+ cmake_cmd.append("-DDOC_OUTPUT_FORMAT=html")
+ else:
+ log.info("Output format will be qthelp")
+ cmake_cmd.append("-DDOC_OUTPUT_FORMAT=qthelp")
+ else:
+ cmake_cmd.append("-DSKIP_DOCS=1")
if not OPTION["SKIP_CMAKE"]:
log.info(f"Configuring module {extension} ({module_src_dir})...")
@@ -892,6 +897,7 @@ class PysideBuild(_build, DistUtilsCommandMixin):
log.info("Sphinx not found, skipping documentation build")
else:
log.info("Skipped documentation generation")
+ cmake_cmd.append("-DSKIP_DOCS=1")
if not OPTION["SKIP_MAKE_INSTALL"]:
log.info(f"Installing module {extension}...")
diff --git a/sources/pyside6/CMakeLists.txt b/sources/pyside6/CMakeLists.txt
index cde216f14..5133e878e 100644
--- a/sources/pyside6/CMakeLists.txt
+++ b/sources/pyside6/CMakeLists.txt
@@ -247,7 +247,7 @@ endif ()
find_program(SPHINX_BUILD sphinx-build)
find_program(DOT_EXEC dot)
-if (QT_SRC_DIR AND SPHINX_BUILD AND DOT_EXEC)
+if (QT_SRC_DIR AND SPHINX_BUILD AND DOT_EXEC AND NOT SKIP_DOCS)
add_subdirectory(doc)
else ()
set(DOCS_TARGET_DISABLED_MESSAGE "apidoc generation targets disabled.")