Skip to content

Latest commit

 

History

History
109 lines (65 loc) · 3.37 KB

INSTALL.md

File metadata and controls

109 lines (65 loc) · 3.37 KB

Diagnosticism - Installation and Use

Table of Contents

Diagnosticism is a classic-form C/C++ library, insofar as it has implementation files in its src directory and header files in its include/diagnosticism directory. Thus, once "installed", one must simply include diagnosticism/XXXX.h (where XXXX might be doomgram, or ev, or another of the API headers).

You may elect to compile in the src file(s) needed, but the standard way to do so is to build and install the library via CMake as described below.

NOTE: Diagnosticism::core has no install-time package dependencies. STLSoft, xTests, and optional shwild are required only when building automated tests (BUILD_TESTING=ON). Use ./prepare_cmake.sh --disable-testing (or -DBUILD_TESTING=OFF) for a library-only configure/build/install.

Using CMake

Obtain the latest distribution of Diagnosticism

You can obtain a .zip or .tar.gz at the Releases page, e.g.:

$ mkdir -p ~/open-source
$ cd ~/open-source
$ curl -L -O https://github.com/synesissoftware/Diagnosticism/archive/refs/tags/0.2.0-beta4.tar.gz
$ gunzip 0.2.0-beta4.tar.gz
$ cd Diagnosticism-0.2.0-beta4

Or you may prefer to clone the project via git

$ mkdir -p ~/open-source
$ cd ~/open-source
$ git clone https://github.com/synesissoftware/Diagnosticism/
$ cd Diagnosticism

Prepare the CMake configuration

Prepare the CMake configuration, via the prepare_cmake.sh script, as in:

./prepare_cmake.sh

By default, this will create a _build directory under the project directory. If you want to use a specific directory you can do so via the environment variable SIS_CMAKE_BUILD_DIR.

$ export SIS_CMAKE_BUILD_DIR=/tmp/Diagnosticism
$ ./prepare_cmake.sh

NOTE: If you provide the flag --run-make (=== -m) then the script will also run a build, so the Build step can be skipped.

Visual C++ with Static Dependency on Standard Library

export SIS_CMAKE_BUILD_DIR=/tmp/Diagnosticism
./prepare_cmake.sh --msvc-mt

Build

./build_cmake.sh

NOTE: If you provide the flag --run-make (=== -m) in step 3 then you do not need this step.

  1. As a check, execute the built test program files via the build_run_all_unit_tests.sh script, as in:
./run_all_unit_tests.sh -M

NOTE: If you do not provide the flag --no-make (=== -M) then the script will also run a build.

Install

  1. Install the library on the host, via cmake, as in:
sudo cmake --install ${SIS_CMAKE_BUILD_DIR:-./_build} --config Release
  1. Consume from another CMake project (no STLSoft / xTests required):
find_package(Diagnosticism REQUIRED)
target_link_libraries(myapp PRIVATE Diagnosticism::core)