From c21932163779bcfe4577ac2e3326b8c113884829 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 29 Nov 2020 12:58:47 +0100 Subject: cmake: Fix building documentation It was never implemented Fixes: QBS-1618 Change-Id: I702410b546cacd439989268d3d4fbb18051d1819 Reviewed-by: Christian Kandeler --- doc/CMakeLists.txt | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 doc/CMakeLists.txt (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 000000000..9357dcf63 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,45 @@ +if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) + 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() + + add_custom_target( + BuildQbsDocumentation ALL + COMMAND ${UPDATE_PATH_COMMAND} + 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 + project.withCode:false + project.withDocumentation:true + profile:none + modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} + modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} + moduleProviders.Qt.qmakeFilePaths:${QT_QMAKE_EXECUTABLE} + 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 + ) + install( + DIRECTORY ${PROJECT_BINARY_DIR}/doc-build/install-root/share/doc/qbs/html/ + DESTINATION "${QBS_DOC_INSTALL_DIR}" + ) +endif() -- cgit v1.2.3 From 9c8451e9a76f1173d4c7fa4d538e2ed676743110 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 4 Dec 2020 10:42:08 +0100 Subject: Fix that target was accessed before it was created Amends c21932163779bcfe4577ac2e3326b8c113884829 Change-Id: I078df77ebfd7921c9c8bcaf131ae06a3a1fcd181 Reviewed-by: Ivan Komissarov --- doc/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9357dcf63..81790f845 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -13,6 +13,7 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) set(_INSTALL_QCH_DOCS false) endif() + get_update_path_command(UPDATE_PATH_COMMAND) add_custom_target( BuildQbsDocumentation ALL COMMAND ${UPDATE_PATH_COMMAND} -- cgit v1.2.3 From 838e91d47b3e6c2e022cde30b53001460dca9a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cotty?= Date: Mon, 7 Dec 2020 11:53:16 +0100 Subject: JSON API: use fullDisplayName in dependencies array Change the dependencies array to use the product full display name instead of just the name. That allows clients to search for the multiplexed products using the dependencies json array of the aggregate product. Clients are then able to properly update the search path of the dynamic libraries generated in the multiplexed products. Change-Id: I3dd8b66e2cb637e501cbfe29c670c57c2cea5f7b Reviewed-by: Christian Kandeler --- doc/appendix/json-api.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/appendix/json-api.qdoc b/doc/appendix/json-api.qdoc index 959b30bb7..78e359017 100644 --- a/doc/appendix/json-api.qdoc +++ b/doc/appendix/json-api.qdoc @@ -628,8 +628,8 @@ \row \li version \li string \endtable - The \c dependencies are the names of products that occur in the (enabled) - \l Depends items of this product. + The elements of the \c dependencies array correspond to the full-display-name + properties of the products that this product has pulled in via \l Depends items. The \c generated-artifacts are files that are created by the \l{Rule}{rules} in this product. -- cgit v1.2.3 From 1224e3ce400691c58ea21758a186451841a12b57 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Mon, 7 Dec 2020 15:40:55 +0100 Subject: doc: fix bundle.resources property type Change-Id: I5458b20c4105497b8f647a43299c3e727172577b Reviewed-by: Christian Kandeler --- doc/reference/modules/bundle-module.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/reference/modules/bundle-module.qdoc b/doc/reference/modules/bundle-module.qdoc index e3c21cd3c..9595f1d03 100644 --- a/doc/reference/modules/bundle-module.qdoc +++ b/doc/reference/modules/bundle-module.qdoc @@ -204,7 +204,7 @@ */ /*! - \qmlproperty bool bundle::resources + \qmlproperty pathList bundle::resources A list of resources to copy to a bundle's \c Resources subdirectory. Files will automatically be copied into \c lproj subdirectories corresponding to -- cgit v1.2.3 From 8095f33419c13192df9e5acd06cc73b2cde8ca2b Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Fri, 4 Dec 2020 17:02:37 +0300 Subject: doc: Cleanup and update information about QBS and IDEs integration Change-Id: Ieb36a6ba96666f07cd1c22383964f8ecd5acdd33 Reviewed-by: Christian Kandeler --- doc/qbs.qdoc | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'doc') diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 217e41e7c..656a1245d 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -299,25 +299,39 @@ \section2 IDE Integration \QBS can be used not only from the command line, but also in combination - with an IDE, such as Qt Creator, Microsoft Visual Studio, or Xcode. - Qt Creator directly supports \QBS projects. Visual Studio and Xcode users - can use \QBS to generate Microsoft Visual Studio and Xcode projects. - For more information, see \l {Generators}. + 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 + 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}. + + In addition, \QBS can generate projects for Visual Studio, IAR EW, and + Keil uVision, but it still is an experimental option. For more information, + see \l {Generators}. \section3 Qt Creator - \l{http://doc.qt.io/qtcreator/index.html}{Qt Creator} uses the same \QBS - library as the \QBS command line tools. Therefore, it can retrieve all the - information required to build a single file or project through a defined - public API. Qt Creator provides accurate information about the build - progress and displays a project tree that reflects the logical structure of - the project, instead of presenting low-level information, such as the file - system structure. Adding or removing source files keeps the existing project - file structure intact. + \l{http://doc.qt.io/qtcreator/index.html}{Qt Creator} provides accurate + information about the build progress and displays a project tree that + reflects the logical structure of the project, instead of presenting low-level + information, such as the file system structure. Adding or removing source + files keeps the existing project file structure intact. For more information about using \QBS to build projects from Qt Creator, see \l{http://doc.qt.io/qtcreator/creator-project-qbs.html}{Setting Up Qbs}. + \section3 Visual Studio Code + + \l{https://code.visualstudio.com/}{Visual Studio Code} provides the + {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. + + For more information about using \QBS to build projects from Visual Studio Code, + see \l{https://github.com/denis-shienkov/vscode-qbs/blob/master/docs/how-to.md} + {How To}. + \section1 Build Process \image qbs-build-process.png -- cgit v1.2.3 From 2e66f7cc4c5b8600308463f75fa09a1a5372c48f Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Wed, 9 Dec 2020 10:48:21 +0100 Subject: cmake: Doc should depend on qbs_processlauncher Amends b946dd352114e70bee5203ea02bb7be11f8ab998. Change-Id: I89b4fd32b1087f542678aab34a208e6c5eee9c12 Reviewed-by: Eike Ziller --- doc/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 81790f845..48d0e22e7 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -37,7 +37,7 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) -d ${PROJECT_BINARY_DIR}/ config:doc-build -p "qbs documentation" - DEPENDS qbs copy-runtime-files-qbs + DEPENDS qbs copy-runtime-files-qbs qbs_processlauncher ) install( DIRECTORY ${PROJECT_BINARY_DIR}/doc-build/install-root/share/doc/qbs/html/ -- cgit v1.2.3 From 8c6b7b20d0ff7a6c41582a9c470d98c4e5838c56 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Wed, 9 Dec 2020 11:17:01 +0100 Subject: cmake: Fix path to qmake and qbs.buildVariant when building docs Change-Id: Ie9cfe4bd59ef8b692c522b4af97f9919624b37b7 Reviewed-by: Eike Ziller --- doc/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 48d0e22e7..52dfad270 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -13,6 +13,7 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) set(_INSTALL_QCH_DOCS false) endif() + get_target_property(_QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_update_path_command(UPDATE_PATH_COMMAND) add_custom_target( BuildQbsDocumentation ALL @@ -24,12 +25,13 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) -d ${PROJECT_BINARY_DIR}/ config:doc-build qbs.installPrefix:undefined + qbs.buildVariant:release project.withCode:false project.withDocumentation:true profile:none modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} - moduleProviders.Qt.qmakeFilePaths:${QT_QMAKE_EXECUTABLE} + moduleProviders.Qt.qmakeFilePaths:${_QT_QMAKE_EXECUTABLE} COMMAND ${_QBS_OUTPUT_DIR}/qbs build --settings-dir ${PROJECT_BINARY_DIR}/settings -- cgit v1.2.3 From 728c5d40fb7c4137810658a86e4b90f0499368ce Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Wed, 9 Dec 2020 14:01:32 +0100 Subject: cmake: check for presence of lxml and bs4 python modules Change-Id: Ifeecfa25af36d022529c10e1914cf0dd36e8c82c Reviewed-by: Eike Ziller --- doc/CMakeLists.txt | 119 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 77 insertions(+), 42 deletions(-) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 52dfad270..e12520208 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,48 +1,83 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) - 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() + find_package(Python3 COMPONENTS Interpreter) + + 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) - if (QBS_INSTALL_QCH_DOCS) - set(_INSTALL_QCH_DOCS true) + 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 Qt5::qmake IMPORTED_LOCATION) + get_update_path_command(UPDATE_PATH_COMMAND) + add_custom_target( + BuildQbsDocumentation ALL + COMMAND ${UPDATE_PATH_COMMAND} + 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 + modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} + modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} + moduleProviders.Qt.qmakeFilePaths:${_QT_QMAKE_EXECUTABLE} + 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() - set(_INSTALL_QCH_DOCS false) + message(WARNING "Cannot find python3 binary. Qbs documentation will not be built.") endif() - - get_target_property(_QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) - get_update_path_command(UPDATE_PATH_COMMAND) - add_custom_target( - BuildQbsDocumentation ALL - COMMAND ${UPDATE_PATH_COMMAND} - 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 - modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} - modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} - moduleProviders.Qt.qmakeFilePaths:${_QT_QMAKE_EXECUTABLE} - 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}" - ) endif() -- cgit v1.2.3 From 647ad9092207f0d317c3f3ac70fd8810d7929462 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Fri, 11 Dec 2020 11:16:51 +0100 Subject: cmake: Pass python3 from CMake to Qbs ...to avoid fuss with possibly different Python versions found by CMake and Qbs Change-Id: I887f8aed8ed52b2766c0c1c411525b433b21458a Reviewed-by: Eike Ziller --- doc/CMakeLists.txt | 1 + doc/doc.qbs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index e12520208..74d71f4dc 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -58,6 +58,7 @@ if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) 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} diff --git a/doc/doc.qbs b/doc/doc.qbs index 8d7da8d04..8ab6cfdb9 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -21,7 +21,7 @@ Project { id: pythonProbe names: ["python3", "python"] // on Windows, there's no python3 } - property string _pythonExe: pythonProbe.found ? pythonProbe.filePath : undefined + property string pythonPath: pythonProbe.found ? pythonProbe.filePath : undefined files: [ "../README.md", @@ -66,11 +66,11 @@ Project { outputFileTags: ["qdoc-html", "qbsdoc.dummy"] // TODO: Hack. Rule injection to the rescue? outputArtifacts: [{filePath: "dummy", fileTags: ["qbsdoc.dummy"]}] prepare: { - if (!product._pythonExe) + if (!product.pythonPath) throw "Python executable was not found"; var scriptPath = explicitlyDependsOn["qbsdoc.fiximports"][0].filePath; var htmlDir = FileInfo.path(FileInfo.path(inputs["qdoc-png"][0].filePath)); - var fixCmd = new Command(product._pythonExe, [scriptPath, htmlDir]); + var fixCmd = new Command(product.pythonPath, [scriptPath, htmlDir]); fixCmd.description = "fixing bogus QML import statements"; return [fixCmd]; } -- cgit v1.2.3 From 3f7c006da99729dd86395c3750d6b4fec8e2cb1b Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sun, 13 Dec 2020 17:04:04 +0100 Subject: doc: Fix doc about bundle.indentifier and indentifierPrefix Change-Id: If381b6fab70732a6d980bd1334b709b49e7e2734 Reviewed-by: Christian Kandeler --- doc/reference/modules/bundle-module.qdoc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/reference/modules/bundle-module.qdoc b/doc/reference/modules/bundle-module.qdoc index 9595f1d03..4184672b4 100644 --- a/doc/reference/modules/bundle-module.qdoc +++ b/doc/reference/modules/bundle-module.qdoc @@ -96,8 +96,9 @@ A prefix for the product's bundle identifier. If \l{bundle::}{identifier} is left unset, the bundle identifier will be a concatenation of this value - and the \l{bundle::}{identifier} property, separated by a period (.). This - corresponds to the organization identifier in Xcode. + and the \l{Product::targetName}{Product.targetName} property formatted as + an RFC-1034 identifier, separated by a period (.). This corresponds to the + organization identifier in Xcode. \defaultvalue \c{org.example} */ @@ -106,8 +107,9 @@ \qmlproperty string bundle::identifier The bundle's identifier. If left unset, the bundle identifier will be a - concatenation of this value and the \l{bundle::}{identifierPrefix} property, - separated by a period (.). + concatenation of the \l{bundle::}{identifierPrefix} value and the + \l{Product::targetName}{Product.targetName} propertyy formatted as an + RFC-1034 identifier, separated by a period (.). \defaultvalue A combination of \l{bundle::}{identifierPrefix} and the product's target name formatted as an RFC-1034 identifier. -- cgit v1.2.3