Skip to content

Commit

Permalink
Updated Readme and Changelog with cpack info
Browse files Browse the repository at this point in the history
  • Loading branch information
bernedom committed Jul 8, 2019
1 parent 6b5594c commit c926326
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* cmake requires version 3.12 to support add_executable without sources and verbose project description
* all headers are prefixed with a license tag
* Added support for cpack (see README for usage)

## 1.0.0

Expand Down
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.12)



project("SI" VERSION 1.0.1
DESCRIPTION "A header only c++ library that provides type safety and user defined literals for handling pyhsical values defined in the International System of Units."
HOMEPAGE_URL "https://github.com/bernedom/SI")
project(
"SI"
VERSION
1.0.1
DESCRIPTION
"A header only c++ library that provides type safety and user defined literals for handling pyhsical values defined in the International System of Units."
HOMEPAGE_URL
"https://github.com/bernedom/SI")

add_library(${PROJECT_NAME} INTERFACE)
# add alias so the project can be uses with add_subdirectory
Expand Down Expand Up @@ -50,4 +53,4 @@ install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"

install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/SI DESTINATION include)

include(CPack)
include(CPack)
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ All units that can be built from other units are also decayable to the respectiv
SI is a header only libary that uses **C++17** features. Building is tested using cmake > 3.5 and verified for g++7, g++8, clang5, clang6, clang7, msvc 19, and AppleClang 10.0.
to build use
to build use
```bash
mkdir build
cd build
Expand All @@ -121,6 +122,7 @@ cmake --build . --config Release --target install -- -j $(nproc)
```

Consider running the build/install command with setting the install prefix, if you do not want to install SI system wide

```bash
-DCMAKE_INSTALL_PREFIX:PATH=${HOME}/SI-install
```
Expand All @@ -137,11 +139,20 @@ cmake ..
cmake --build . --config Release --target package -- -j $(nproc)
```

This creates gzipped archives containing all files as well as an installation script `SI-<version>-<plattform>.sh`.

```bash
cd build
mkdir ${HOME}/SI-install
./SI-1.0.1-Linux.sh --prefix=$HOME/SI-install --skip-license --exclude-subdir
```

## Building the tests

The tests use [Catch2](https://github.com/catchorg/Catch2) version 2.7 which relies on libstdc++8

For ubuntu releases < 18.04 use:

```bash
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
Expand All @@ -152,4 +163,4 @@ sudo apt install libstdc++-8-dev

I'm using more or less strict TDD for implementing the functionality. First to check if the code actually does what I want it to do, but also as a way to set examples how SI is used. The nice benefit of it being, that I'm dogfooding the library to myself while developing. I'm using [Catch2](https://github.com/catchorg/Catch2) as a unit-testing framework, however since the goal is to be able to do as much as possible during compile time most of the tests are performed with Catch2 `STATIC_REQUIRES` which contatain `static_asserts` and run-time `REQUIRE`s as testing assert.

This means if the tests compile then the tests are correct. To compile only with runtime check pass `-DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE` to the compilers.
This means if the tests compile then the tests are correct. To compile only with runtime check pass `-DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE` to the compilers.

0 comments on commit c926326

Please sign in to comment.