diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d116b3b2bfa69662c129d50fbcc5ba710fe9f1f1..32fd692ada99c2efe2cb966b5b0e0f1ec3138960 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -115,7 +115,7 @@ pages: - tar xfz coverage.tar.gz # TODO: Add an index page with links to the documentation and coverage. -abi-deplay: +abi-deploy: stage: deploy needs: ["versioning", "build-docker-ubuntu-22.04"] image: $BASE_IMAGE diff --git a/README.md b/README.md index f2a724f8e16faf0640f676c4af47c29562b9d9d8..1015fe43378a4cfe682b16f797e84b461080e39f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ project. The template offers: - A basic Docker file to be used in the CI - A CMake project skeleton - - A Doxygen and Sphinx skeleton for documentation + - A Doxygen and Sphinx skeleton for documentation, combined with Breathe - Formatting scripts for the code Note: The project is intended to be used for C++ projects without Fortran code. @@ -24,8 +24,18 @@ project needs to be changed to use `make`. - Clone the project in the directory `$repo` - Install all dependencies as listed in `ci/ubuntu_22_04-base` -- Create the project: `cmake -DBUILD_TESTING=ON -H$repo -B$repo/build -G Ninja` -- Build the project: `ninja -C $repo/build` +- Create build directory: `mkdir build` +- Create the project: `cmake -DBUILD_TESTING=ON -DBUILD_DOCUMENTATION=ON -B ./build -G Ninja` +- Build the project: `ninja -C ./build` + +Specific targets can also be build on a case per case basis use `ninja -C ./build/ -t targets` +to list all of them. + +For instance: +- Build the documentation: `ninja -C ./build/ sphinx` +- Run unit tests: `ninja -C ./build/ test` +- Install the project globally: ``ninja -C ./build/ install`` +- Clean caches: `ninja -C ./build/ clean` ## Contributing diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 6bfaff1a5ebf04666c10d27a070e85f90661fea5..014ddb5195bb61d21e053693ca6842744c73307f 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -18,6 +18,12 @@ import sys # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. + +project = "CPP" + +# TODO(): Extract version metadata from CMake and make available in Sphinx +# version = "" + extensions = [ "breathe", ] diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index 8a7fc4c2ab5c5e99c4dbe85854036893ed3a0e40..b6b063ec83bd8bdcf5635e82c851f3297e318999 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -6,4 +6,7 @@ Docs ==== -.. doxygenfunction:: Hello +This text is added through ReStructuredText (RST) in Sphinx while the below +is derived from Doxygen: + +.. doxygenindex:: diff --git a/include/hello.hpp b/include/hello.hpp index a6ff93eaa0aa5f262d77723d15f74e7421b7c2ae..995fcc059effa8e75911205dd0046c31dd7a39a5 100644 --- a/include/hello.hpp +++ b/include/hello.hpp @@ -6,7 +6,13 @@ namespace lib { -/** This function greets the user. */ +/** This function greets the user. + * + * @code + * char *buffer = new char[42]; + * int charsAdded = sprintf(buffer, "Include code\n", 8); + * @endcode + */ void Hello(); } // namespace lib