From 414630a09a3d2be8a6483649a8746a6bc712cc08 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 19 Sep 2023 15:22:20 -0400 Subject: [PATCH] doc: expand build instructions --- CMakeLists.txt | 8 ++++++-- README.md | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb0649b..b5a8caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,15 @@ enable_testing() # always write compile_commands.json set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") +if(NOT USER) + set(USER $ENV{USER}) +endif() + if(NOT CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX /home/roland/local CACHE STRING "install directory") + set(CMAKE_INSTALL_PREFIX /home/${USER}/local CACHE STRING "install directory") endif() if(NOT CMAKE_INSTALL_RPATH) - set(CMAKE_INSTALL_RPATH /home/roland/local/lib CACHE STRING "runpath in installed libraries/executables") + set(CMAKE_INSTALL_RPATH /home/${USER}/local/lib CACHE STRING "runpath in installed libraries/executables") endif() include(cmake/nestlog.cmake) diff --git a/README.md b/README.md index 1db16b1..22e8bf6 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,27 @@ Indentlog is a lightweight header-only library for console logging. - logger is 'truthy' -> only pay for formatting when entry points is enabled. - also provides family of convenience stream-inserters +## Getting Started + +### copy repository locally + +``` +$ git clone git@github.com:rconybea/indentlog.git +$ ls -d indentlog +indentlog +``` + +### build & install + +``` +$ cd indentlog +$ mkdir build +$ cd build +$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. +$ make +$ make install +``` + ## Examples ### 1