Skip to content

Commit

Permalink
Update README and Dockerfile and fix CMake version (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeln authored May 27, 2021
1 parent 7f83b05 commit 594fcf1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
build/
prefix/
CMakeUserPresets.json
.cache
.vcpkg
Testing/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 20 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 594fcf1

Please sign in to comment.