From 9bd7dbc41c54b1c1813ab190d8839e826d74463b Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 20 Mar 2023 22:49:26 +0100 Subject: [PATCH] Use Ninja in build example --- README.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8ed3574..c41e652 100644 --- a/README.md +++ b/README.md @@ -78,18 +78,26 @@ The following counts for `c++utilities` and my other libraries unless stated oth * For dependencies of my other projects check the README.md of these projects. ### How to build -Example using `make`: +Example: ``` -cd "path/to/build/directory" -cmake -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX="/final/install/location" \ - "path/to/projectdirectory" -make tidy # format source files (optional, must be enabled via CLANG_FORMAT_ENABLED) +cmake -G Ninja \ + -S "path/to/source/directory" \ + -B "path/to/build/directory" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="/final/install/location" make # build the binaries -make check # build and run tests (optional) -make coverage # build and run tests measuring test coverage (optional, must be enabled via CLANG_SOURCE_BASED_COVERAGE_ENABLED) -make apidoc # build API documentation (optional) -make DESTDIR="/temporary/install/location" install # install binaries, headers and additional files +cmake --build "path/to/build/directory" +# format source files (optional, must be enabled via CLANG_FORMAT_ENABLED) +cmake --build "path/to/build/directory" --target tidy +# build and run tests (optional) +cmake --build "path/to/build/directory" --target check +# build and run tests measuring test coverage (optional, must be enabled via CLANG_SOURCE_BASED_COVERAGE_ENABLED) +cmake --build "path/to/build/directory" --target coverage +# build API documentation (optional) +cmake --build "path/to/build/directory" --target apidoc +# install binaries, headers and additional files +DESTDIR="/temporary/install/location" \ + cmake --install "path/to/build/directory" ``` #### General notes