From 594fcf11afde0e6bb24c07382351507f693651f1 Mon Sep 17 00:00:00 2001 From: Carl Dehlin <47060734+cdeln@users.noreply.github.com> Date: Thu, 27 May 2021 08:47:45 +0200 Subject: [PATCH] Update README and Dockerfile and fix CMake version (#10) --- .gitignore | 3 +++ CMakeLists.txt | 2 +- Dockerfile | 39 ++++++++++++++++++++------------------- README.md | 36 ++++++++++++++++++------------------ 4 files changed, 42 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 2ac1559..f909f68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ build/ prefix/ CMakeUserPresets.json +.cache +.vcpkg +Testing/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f6bdc1e..74dfafb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ include(cmake/in-source-guard.cmake) project( enum_set - VERSION 0.1.0 + VERSION 0.0.2 DESCRIPTION "A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iterating over those." HOMEPAGE_URL "https://github.com/cdeln/cpp_enum_set" LANGUAGES CXX diff --git a/Dockerfile b/Dockerfile index 061620f..9a78f7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,30 @@ FROM ubuntu:20.04 -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive # Install standard dependencies. RUN apt-get update && apt-get install -y \ build-essential \ clang \ - cmake \ - doctest-dev \ - gcovr \ + clang-tidy \ + cppcheck \ + curl \ git \ - wget + lcov \ + tar \ + unzip \ + wget \ + zip -# Install cppcheck. -# The version provided by apt is too old. -RUN wget https://github.com/danmar/cppcheck/archive/2.4.1.tar.gz -O cppcheck.tar.gz \ - && mkdir cppcheck-src \ - && tar -xf cppcheck.tar.gz --strip-components 1 -C cppcheck-src \ - && cmake -B cppcheck-bin -S cppcheck-src -DCMAKE_BUILD_TYPE=Release \ - && cmake --build cppcheck-bin --parallel \ - && cmake --install cppcheck-bin +# Install minimal CMake version +ENV CMAKE_VERSION=3.19.8 +RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \ + && tar -xf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz \ + && cp -r cmake-${CMAKE_VERSION}-Linux-x86_64/* /usr/ \ + && rm -rf cmake-${CMAKE_VERSION}-Linux-x64-64 -# Install magic_enum. -RUN git clone https://github.com/Neargye/magic_enum.git \ - && cd magic_enum \ - && git checkout v0.7.2 \ - && cmake -B build -S . \ - && cmake --install build +# Install vcpkg +ENV VCPKG_DISABLE_METRICS= +ENV VCPKG_ROOT=/vcpkg +RUN git clone https://github.com/microsoft/vcpkg \ + && ./vcpkg/bootstrap-vcpkg.sh diff --git a/README.md b/README.md index c537de1..1ec517e 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ Requires at least C++14, and C++17 if you want to use it together with [magic en ## Installation -To install the library, run `make install`. +There are two ways of installing this library -If you do not have Make installed, just copy the contents of the `include` folder to your installation path. + 1. Poor mans installation: Just copy the contents of the `include` folder to your installation path. + 2. Using CMake: see [BUILDING][1] for detailed installation instructions. ## Usage @@ -120,23 +121,22 @@ See [this example](example/basic_tutorial.cpp) for a tutorial on available metho See [this example](example/visitation_example.cpp) for an illustration of the visitor pattern with `type_set`. -## Development +## Contributing -For development, the following libraries are used +Feel free to grab an issue from the [issue list][3]. Make a fork and submit a PR. +We currently don't have any dedicated forum for discussion, +if you have any ideas on how to improve the library and there is no issue for it, +feel free to submit an issue yourself and we can discuss the idea there. - * [cppcheck](http://cppcheck.sourceforge.net) for static code analysis. - * [doctest](https://github.com/onqtam/doctest) for unit testing. +See [HACKING][2] for detailed instructions on setting up the developer environment. -See the [Dockerfile](Dockerfile) for detailed installation instructions on Ubuntu 20.04. +See the [Dockerfile][4] for a minimal reproducible environment. +Running the instructions given by the other documents inside the built container should work. +The Dockerfile should, but is not guaranteed to, reflect the steps used by the CI. +To see the exact steps used by the CI, see the [GitHub workflow config file][5]. -To run static analysis, run `make analyze`. - -To run the tests, run `make test`. - -To get coverage information, run `make cover`. - -To get a coverage report, run `make report`. - -To build the docker image, run `make docker_build`. - -To run the docker container, run `make docker_run`. +[1]: BUILDING.md +[2]: HACKING.md +[3]: https://github.com/cdeln/cpp_enum_set/issues +[4]: Dockerfile +[5]: .github/workflows/ci.yml