diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-07-25 16:51:21 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-07-25 15:17:09 +0000 |
commit | aac61d9e35374aa4a309aaa2110f0bf6f67a598b (patch) | |
tree | 9696a41052027dfd2b8bcfc99e9db7dee2a256ab | |
parent | 0e6c8c34d128c9bada575193f8da25268285622c (diff) |
Don't cancel build if python sphinx package is not installed
When building the docs target in PySide2, if the sphinx command is not
successfully found, the build stops with an error. Instead of
cancelling the build, just print a warning message just like it is
done in the shiboken project file.
Change-Id: I00ec7c306db5140f65973e622f4b1744cfd0d26e
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/pyside2/CMakeLists.txt | 15 | ||||
-rw-r--r-- | sources/pyside2/doc/CMakeLists.txt | 5 |
2 files changed, 13 insertions, 7 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index d89b0f890..7799c0c7a 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -354,9 +354,20 @@ if (BUILD_TESTS) add_subdirectory(tests) endif () +find_program(SPHINX_BUILD sphinx-build) find_program(DOT_EXEC dot) -if (QT_SRC_DIR AND DOT_EXEC) + +if (QT_SRC_DIR AND SPHINX_BUILD AND DOT_EXEC) add_subdirectory(doc) else () - message(STATUS "QT_SRC_DIR variable not set or graphviz not found, apidoc generation targets disabled.") + set(DOCS_TARGET_DISABLED_MESSAGE "apidoc generation targets disabled.") + if (NOT QT_SRC_DIR) + message(STATUS "QT_SRC_DIR variable not set, ${DOCS_TARGET_DISABLED_MESSAGE}") + elseif (NOT SPHINX_BUILD) + message(STATUS "sphinx-build command not found, ${DOCS_TARGET_DISABLED_MESSAGE}") + elseif (NOT DOT_EXEC) + message(STATUS "graphviz not found, ${DOCS_TARGET_DISABLED_MESSAGE}") + else() + message(STATUS "Unknown issue occurred, ${DOCS_TARGET_DISABLED_MESSAGE}") + endif() endif() diff --git a/sources/pyside2/doc/CMakeLists.txt b/sources/pyside2/doc/CMakeLists.txt index c5d0169d1..14af9735b 100644 --- a/sources/pyside2/doc/CMakeLists.txt +++ b/sources/pyside2/doc/CMakeLists.txt @@ -8,11 +8,6 @@ add_custom_target(qdoc3 COMMENT "Running qdoc3 against Qt source code..." SOURCE "pyside.qdocconf") - -find_program(SPHINX_BUILD NAMES sphinx-build) -if (${SPHINX_BUILD} MATCHES "SPHINX_BUILD-NOTFOUND") - message(FATAL_ERROR "sphinx-build command not found.") -endif() add_custom_target(apidoc COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} ${SPHINX_BUILD} -b html ${CMAKE_CURRENT_BINARY_DIR}/rst html |