From c99d02d9c9e9a010c72619e4cbd3cc44596ee1ee Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Mon, 13 Jan 2020 14:40:23 +0100 Subject: [PATCH] + more documentation --- README.md | 35 +++++++++++++++++++------ build-fast.sh => build-release.sh | 11 +++++--- install.sh | 43 ++++++++++--------------------- 3 files changed, 49 insertions(+), 40 deletions(-) rename build-fast.sh => build-release.sh (80%) diff --git a/README.md b/README.md index 05768dc..69987e8 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # vKVM Scripts -install & build all subprojects with one script +install, build & run all subprojects with one script ## Prerequisites - *nix operating system - package manager (either apt, pacman or homebrew) - git -- a c++14 compatible compiler -- ssh key added to your gitlab profile +- (optional) ssh key added to your gitlab profile ---- @@ -19,26 +18,46 @@ install & build all subprojects with one script run this once in a empty directory. +as a user: ```sh -git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/installation.git +git clone https://gitlab.repo.digitech.hs-emden-leer.de/link/projekte/ws19/vkvm-new/installation.git cd installation install.sh ``` +or as a project developer (ssh key needed): +```sh +git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/installation.git +cd installation +install.sh -dev +``` + + **update all subprojects** ```sh update.sh ``` +**build all projects** + +```sh +build.sh +``` + **checkout development versions** ```sh checkout-dev.sh ``` -**build all projects** +## Troubleshooting -```sh -build.sh -``` \ No newline at end of file +please make shure that all of the following packages have been installed by your package manager: +- clang +- clang_tidy +- make +- cmake +- catch2 +- fltk +- tmux diff --git a/build-fast.sh b/build-release.sh similarity index 80% rename from build-fast.sh rename to build-release.sh index 0ff3f12..df25cfe 100755 --- a/build-fast.sh +++ b/build-release.sh @@ -5,40 +5,45 @@ echo 'building all components' cd .. #building library first +mkdir library/build cd library/build cmake .. -DCMAKE_BUILD_TYPE=Release make library cd ../.. + +mkdir demo/build cd demo/build cmake .. -DCMAKE_BUILD_TYPE=Release make Demo cd ../.. +mkdir gui/build cd gui/build cmake .. -DCMAKE_BUILD_TYPE=Release make GUI cd ../.. +mkdir shared-memory/build cd shared-memory/build cmake .. -DCMAKE_BUILD_TYPE=Release make SharedMemory cd ../.. +mkdir simple-draw/build cd simple-draw/build cmake .. -DCMAKE_BUILD_TYPE=Release make SimpleDraw cd ../.. +mkdir terminal/build cd terminal/build cmake .. -DCMAKE_BUILD_TYPE=Release make Terminal cd ../.. +mkdir text-renderer/build cd text-renderer/build cmake .. -DCMAKE_BUILD_TYPE=Release make TextRenderer cd ../.. - - - diff --git a/install.sh b/install.sh index c7575fc..91c88d1 100755 --- a/install.sh +++ b/install.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -development=false +DEVELOPMENT=false install_packages() { if [[ -f /usr/bin/pacman ]]; then - sudo pacman -S clang make cmake fltk catch2 + sudo pacman -S clang make cmake fltk catch2 tmux - elif [[ -f /usr/bin/apt ]]; then - sudo apt install clang make cmake clang-tidy libfltk1.3 libfltk1.3-dev + elif [[ -f /etc/debian_version ]]; then + sudo apt install clang make cmake clang-tidy libfltk1.3 libfltk1.3-dev tmux git clone https://github.com/catchorg/Catch2.git cd Catch2 @@ -16,9 +16,9 @@ install_packages() { cd .. elif [[ -f /usr/local/Homebrew ]]; then - sudo brew install clang make cmake fltk catch2 + sudo brew install clang make cmake fltk catch2 tmux - #some systems have --with-toolchain some dont, so we need to do this + #some systems have --with-toolchain some don't, so we need to do this if ! sudo brew install llvm --with-toolchain; then sudo brew install llvm fi @@ -27,18 +27,12 @@ install_packages() { fi } -while [ -n "$1" ]; do - - case "$1" in - - -dev) development = true ;; - - *) echo "Option $1 not recognized" ;; - - esac - - shift - +while getopts u:d:p:f: option +do +case "${option}" +in +dev) DEVELOPMENT=true;; +esac done install_packages @@ -68,18 +62,9 @@ else fi -mkdir library/build -mkdir shared-memory/build -mkdir text-renderer/build -mkdir gui/build -mkdir terminal/build -mkdir simple-draw/build -mkdir demo/build - - - cd installation echo "installation completed" -./build.sh + +./build-release.sh