diff --git a/doc/web/docs/installation.md b/doc/web/docs/installation.md index 0cc99cf6..006d6bc4 100644 --- a/doc/web/docs/installation.md +++ b/doc/web/docs/installation.md @@ -1,48 +1,70 @@ -QuickQanava Quick Start -============================ +# QuickQanava Quick Start -Dependencies ------------------- +!!! note "Starting from version 2.4.0, QuickQanava is now a fully static library. It is recommended to install it from a Git submodule using CMake." -| Dependency | Mandatory | Included in source tree | Licence | -| --- | :---: | :---: | :---: | -| Google Test/Mock | No | No | Permissive | -- **Google Test** is optional only to build and run tests ![Google Test GitHub](https://github.com/google/googletest). +QuickQanava could be used with either _qmake_ or _CMake_ build configuration system: + - `qmake`: Only for Qt5, to be deprecated soon (20231119, version 2.4.0). + - `CMake`: For both Qt5 and Qt6, can be used trough `add_subdirectory()` or [ExternalProject_Add()](https://cmake.org/cmake/help/latest/module/ExternalProject.html) + + +## Using from external projects with CMake -Building from sources ------------------- +The recommended way of using QuickQanava is to include the library directly as a GIT submodule in your project: -Get the latest QuickQanava sources: +```sh +# Install QuickQanava as a GIT submodule +$ git submodule add https://github.com/cneben/QuickQanava +* git submodule update +``` +From your `CMakeLists.txt`: ```sh -git clone https://github.com/cneben/QuickQanava -cd QuickQanava +add_subdirectory(../../) + +target_include_directories(my_project PUBLIC QuickQanava Qt${QT_VERSION_MAJOR}::QuickControls2) + +target_link_libraries(sample_advanced + QuickQanava + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::Gui + Qt${QT_VERSION_MAJOR}::QuickControls2 +) +``` + +QuickQanava might also be included in CMake trough [ExternalProject_Add()](https://cmake.org/cmake/help/latest/module/ExternalProject.html) directly from GitHub. + + +## Using from external projects with qmake + +From a `./QuickQanava` git submodule, library could be included directly in your main qmake `.pro` file with the following two #include statements: + +```sh +#in your project main .pro qmake configuration file +include($$PWD/QuickQanava/src/quickqanava.pri) ``` -QuickQanava could be used with either _qmake_ or _CMake_ build configuration system. -QuickQanava could be used with either _qmake_ or _CMake_ build configuration system. +## Building samples qmake / CMake (development) -| qmake | cmake | -| :---: | :---: | -| Static build, no QML module, all resources are linked statically trough QRC | Installable or embedable, QuickQanava is loaded using a QML module that need to be installed | +With Qt Creator: -Using qmake: +**Using qmake:** 1. Open _quickqanava.pro_ in QtCreator. 2. Select a kit, build and launch samples. -or (CMake > 3.5) +**Using CMake (CMake > 3.5):** 1. Open _CMakeLists.txt_ in QtCreator. -2. In 'Projects' panel, set DQUICK_QANAVA_BUILD_SAMPLES option to true in CMake configuration panel. +2. for testing purposes, in 'Projects' panel, set DQUICK_QANAVA_BUILD_SAMPLES option to true in CMake configuration panel. 3. Select a kit, build and launch samples. -Or manually using CMake: + +Or build manually using CMake (CI): ```sh $ cd QuickQanava @@ -50,42 +72,22 @@ $ mkdir build $ cd build # IF QT_DIR IS CONFIGURED AND QMAKE IN PATH -$ cmake -DCMAKE_BUILD_TYPE=Release -DQUICK_QANAVA_BUILD_SAMPLES=TRUE .. +$ cmake -DCMAKE_BUILD_TYPE=Release -DQUICK_QANAVA_BUILD_SAMPLES=FALSE .. # IF QT DIR IS NOT CONFIGURED, CONFIGURE KIT MANUALLY -$ cmake -DCMAKE_PREFIX_PATH="/home/b/Qt/5.11.0/gcc_64" -DQT_QMAKE_EXECUTABLE="/home/b/Qt/5.11.0/gcc_64/bin/qmake" -DQUICK_QANAVA_BUILD_SAMPLES=TRUE ../QuickQanava/ +$ cmake -DCMAKE_PREFIX_PATH="/home/b/Qt/5.15.14/gcc_64" -DQT_QMAKE_EXECUTABLE="/home/b/Qt/5.15.14/gcc_64/bin/qmake" -DQUICK_QANAVA_BUILD_SAMPLES=FALSE ../QuickQanava/ $ cmake --build . # Then run the samples in ./samples -# Eventually make install -``` - - -Note that a previously installed "QML plugin" version of QuickQanava might interfere with a fully static build using direct .pri inclusion. Typical error message looks like: - -``` -QQmlApplicationEngine failed to load component -qrc:/nodes.qml:33 module "QuickQanava" plugin "quickqanavaplugin" not found +# There is no make install ``` -QuickQanava and QuickContainers plugins directories could be removed manually from `$QTDIR\..\qml` to fix the problem (ex: rm -rf '~/Qt/5.11.1/gcc_64/qml/QuickQanava'). +## Dependencies +| Dependency | Mandatory | Included in source tree | Licence | +| --- | :---: | :---: | :---: | +| Google Test/Mock | No | No | Permissive | -Using from external projects ------------------- - -The recommended way of using QuickQanava is to include the library directly as a GIT submodule in your project: - -```sh -# Install QuickQanava as a GIT submodule -$ git submodule add https://github.com/cneben/QuickQanava -* git submodule update -``` - -Once GIT has finished downloading, QuickQanava project file could be included directly in your main qmake .pro file with the following two #include statements: +- **Google Test** is optional only to build and run tests ![Google Test GitHub](https://github.com/google/googletest). -```sh -#in your project main .pro qmake configuration file -include($$PWD/QuickQanava/src/quickqanava.pri) -``` diff --git a/doc/web/mkdocs.yml b/doc/web/mkdocs.yml index 3af3e264..37f07d9b 100644 --- a/doc/web/mkdocs.yml +++ b/doc/web/mkdocs.yml @@ -6,7 +6,7 @@ repo_name: 'GitHub' repo_url: 'https://github.com/cneben/QuickQanava' edit_uri: "" -copyright: 'Copyright © 2022 BA' +copyright: 'Copyright © 2023 BA' use_directory_urls: false theme: