From 90ba4e3b8ba61e50ac2d9fe8bb8a44d74cd2d365 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Mon, 26 Sep 2016 21:27:50 +0300 Subject: Add bootstrap scripts --- README.md | 27 ++++++++++++++++++++++++--- bootstrap.bat | 5 +++++ bootstrap.sh | 12 ++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 bootstrap.bat create mode 100755 bootstrap.sh diff --git a/README.md b/README.md index 6a7b65b..a10d448 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,34 @@ A simple to use and build skeleton project for raylib. Uses CMake. -# building and running in 8 easy steps +# Building and running in 6 easy steps + +The commands here will bootstrap your rayskeleton project with it's own raylib +instance (and all of its dependencies). Raylib is automatically downloaded and +built by the bootstrap script. + + $ git clone git@github.com:oswjk/rayskeleton.git + $ cd rayskeleton + $ ./bootstrap.sh + $ cd build + $ make + $ ./src/rayskeleton + +# Building and running with a prebuilt/installed raylib + +If you have built raylib yourself and want to use the same local raylib +installation for multiple projects, you can easily do that by setting the +LOCAL_RAYLIB CMake variable. The variable must point to a directory where you +have installed raylib (i.e., it contains bin, lib, include, etc.) + +In this example I have built raylib in a directory at the same level as +rayskeleton, using a build directory named `build` and installed raylib under +the build directory in a directory named `stage`. $ git clone git@github.com:oswjk/rayskeleton.git $ cd rayskeleton $ mkdir build $ cd build - $ cmake .. - $ make raylib + $ cmake -DCMAKE_INSTALL_PREFIX=stage -DLOCAL_RAYLIB=../raylib/build/stage .. $ make $ ./src/rayskeleton diff --git a/bootstrap.bat b/bootstrap.bat new file mode 100644 index 0000000..1a9a92e --- /dev/null +++ b/bootstrap.bat @@ -0,0 +1,5 @@ +mkdir build +cd build +cmake -DBOOTSTRAP=ON -DCMAKE_INSTALL_PREFIX=stage . +cmake --build . --target raylib +cmake -UBOOTSTRAP . diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..bb31133 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ ! -f bootstrap.sh ]; then + echo "bootstrap.sh must be run from the project root directory" + exit 1 +fi + +mkdir -p build +cd build +cmake -DBOOTSTRAP=ON -DCMAKE_INSTALL_PREFIX=stage . +cmake --build . --target raylib +cmake -UBOOTSTRAP . -- cgit v1.2.3