aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/doc/CMakeLists.txt')
-rw-r--r--sources/pyside6/doc/CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt
index 2d1116871..af750bcd0 100644
--- a/sources/pyside6/doc/CMakeLists.txt
+++ b/sources/pyside6/doc/CMakeLists.txt
@@ -23,6 +23,24 @@ if (NOT FULLDOCSBUILD)
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
endif()
+if (FULLDOCSBUILD)
+ # Fetch and transform the snippets from Qt
+ message(STATUS "Fetching and converting snippets")
+ if ("${QT_SRC_DIR}" STREQUAL "")
+ message(FATAL_ERROR "There is no value set on QT_SRC_DIR, the snippet conversion will fail")
+ endif()
+ set(PYSIDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../")
+ if (QUIET_BUILD)
+ set(SNIPPETS_QUIET_OPTION "-q")
+ endif()
+ set(SNIPPETS_TOOL "${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/snippets_translate/main.py")
+ # Note QT_SRC_DIR points to 'qtbase',
+ # so we use the general SRC directory to copy all the other snippets
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SNIPPETS_TOOL}
+ --qt ${QT_SRC_DIR}/.. --pyside ${PYSIDE_ROOT} -w ${SNIPPETS_QUIET_OPTION}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
+endif()
+
# Generate example gallery
message(STATUS "Generating example gallery")
if (QUIET_BUILD)