diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2021-09-12 09:09:07 +0300 |
---|---|---|
committer | Ivan Komissarov <abbapoh@gmail.com> | 2021-09-12 09:09:07 +0300 |
commit | df68dc926d3fdfe32da829608db477290f4d9327 (patch) | |
tree | 43095f6182e571d7b960d748dd2820db4a8c5768 /doc | |
parent | 21184c9d9eb42592a9f14f2235e634ac0b4a4e6d (diff) | |
parent | a4fb810c09ed79d739bdf28076792ac458c0fcbc (diff) | |
download | qbs-df68dc926d3fdfe32da829608db477290f4d9327.tar.gz |
Merge branch '1.20' into master
Change-Id: Ie9bf8edc074ba747a13721e4877e752028265f2f
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 107 | ||||
-rw-r--r-- | doc/qbs.qdoc | 7 |
2 files changed, 29 insertions, 85 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 96cdab897..5b8ac7636 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,83 +1,28 @@ -if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) +set(_DOC_SOURCES + ../README.md + ../CONTRIBUTING.md + classic.css + external-resources.qdoc + fixnavi.pl + howtos.qdoc + qbs.qdoc + qbs-online.qdocconf + config/style/qt5-sidebar.html + ) - find_package(Python3 COMPONENTS Interpreter) +file(GLOB_RECURSE _DOC_APPENDIX_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/appendix/*") +file(GLOB_RECURSE _DOC_REFERENCE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/reference/*") +file(GLOB_RECURSE _DOC_TEMPLATES_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/templates/*") +file(GLOB_RECURSE _DOC_IMAGES_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/images/*") +file(GLOB_RECURSE _DOC_TARGETS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/targets/*") - function(find_python_module module) - string(TOUPPER ${module} module_upper) - if (NOT PY_${module_upper}) - if (ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") - set(${module}_FIND_REQUIRED TRUE) - endif() - # A module's location is usually a directory, but for binary modules - # it's a .so file. - execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" - "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" - RESULT_VARIABLE _${module}_status - OUTPUT_VARIABLE _${module}_location - ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT _${module}_status) - set(PY_${module_upper} ${_${module}_location} CACHE STRING - "Location of Python module ${module}") - endif() - endif() - find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) - endfunction() - - if (Python3_Interpreter_FOUND) - find_python_module(lxml) - find_python_module(bs4) - if (PY_LXML AND PY_BS4) - - get_target_property(_QBS_OUTPUT_DIR qbs RUNTIME_OUTPUT_DIRECTORY) - - if (QBS_INSTALL_HTML_DOCS) - set(_INSTALL_HTML_DOCS true) - else() - set(_INSTALL_HTML_DOCS false) - endif() - - if (QBS_INSTALL_QCH_DOCS) - set(_INSTALL_QCH_DOCS true) - else() - set(_INSTALL_QCH_DOCS false) - endif() - - get_target_property(_QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) - get_update_path_command(UPDATE_PATH_COMMAND) - add_custom_target( - BuildQbsDocumentation ALL - COMMAND ${CMAKE_COMMAND} -E env "${UPDATE_PATH_COMMAND}" ${_QBS_OUTPUT_DIR}/qbs - resolve - --settings-dir ${PROJECT_BINARY_DIR}/settings - -f ${PROJECT_SOURCE_DIR}/qbs.qbs - -d ${PROJECT_BINARY_DIR}/ - config:doc-build - qbs.installPrefix:undefined - qbs.buildVariant:release - project.withCode:false - project.withDocumentation:true - profile:none - "products.qbs documentation.pythonPath:${Python3_EXECUTABLE}" - modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} - modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} - moduleProviders.Qt.qmakeFilePaths:${_QT_QMAKE_EXECUTABLE} - COMMAND ${CMAKE_COMMAND} -E env "${UPDATE_PATH_COMMAND}" ${_QBS_OUTPUT_DIR}/qbs - build - --settings-dir ${PROJECT_BINARY_DIR}/settings - -f ${PROJECT_SOURCE_DIR}/qbs.qbs - -d ${PROJECT_BINARY_DIR}/ - config:doc-build - -p "qbs documentation" - DEPENDS qbs copy-runtime-files-qbs qbs_processlauncher - ) - install( - DIRECTORY ${PROJECT_BINARY_DIR}/doc-build/install-root/share/doc/qbs/html/ - DESTINATION "${QBS_DOC_INSTALL_DIR}" - ) - else() - message(WARNING "Cannot import lxml and bs4 python modules. Qbs documentation will not be built.") - endif() - else() - message(WARNING "Cannot find python3 binary. Qbs documentation will not be built.") - endif() -endif() +add_qbs_documentation( + "qbs.qdocconf" + SOURCES + ${_DOC_SOURCES} + ${_DOC_APPENDIX_SOURCES} + ${_DOC_REFERENCE_SOURCES} + ${_DOC_TEMPLATES_SOURCES} + ${_DOC_IMAGES_SOURCES} + ${_DOC_TARGETS_SOURCES} + ) diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 2e14e8572..7b8082f55 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -300,10 +300,9 @@ \QBS can be used not only from the command line, but also in combination with an IDE, such as Qt Creator or Visual Studio Code. These IDEs directly - support \QBS projects using the new \QBS - {https://doc.qt.io/qbs/cli-session.html}{session} feature. Thus, these IDEs + support \QBS projects using the new \QBS \l{session} feature. Thus, these IDEs can retrieve all the information required to build a single file or project - through a session's JSON protocol {https://doc.qt.io/qbs/json-api.html}{API}. + through a session's JSON protocol \l{Appendix C: The JSON API}{API}. In addition, \QBS can generate projects for Visual Studio, IAR EW, and Keil uVision, but it still is an experimental option. For more information, @@ -323,7 +322,7 @@ \section3 Visual Studio Code \l{https://code.visualstudio.com/}{Visual Studio Code} provides the - {https://marketplace.visualstudio.com/items?itemName=qbs-community.qbs-tools} + \l{https://marketplace.visualstudio.com/items?itemName=qbs-community.qbs-tools} {qbs-community} plugin that provides accurate information about the build progress and displays a project tree that reflects the logical structure of the project. Also, it can provide low-level information, such as the file system structure. |