From b175747d786556305205b442f178a223cb0dd342 Mon Sep 17 00:00:00 2001 From: "David R. MacIver" Date: Tue, 2 May 2017 17:14:31 +0100 Subject: [PATCH] Update README.md with the saga of the build --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/README.md b/README.md index 651fb52..58e4387 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,56 @@ Useful flags: * `--output ` - a png file will be produced at the given location with the contents of the rendered shader (default is `output.png`) * `--vertex ` - provide a custom vertex shader file rather than using the default (provided in `get_image.cpp`). + +## Building + +Building the project uses CMake. + +First you must ensure you have the depdencies. There are scripts in buildscripts +intended to run on the CI that can also be used to build locally. You can run +these as follows: + +On Windows: + +```bash +bash buildscripts\1-install-deps-appveyor.sh +``` + +On Linux or OSX: + +```bash +bash buildscripts/1-install-deps-travis.sh +``` + +(This will probably fail with an error at the last step, but all that matters is that the deps are created) + +Once you have the deps downloaded, you can build with CMake as follows: + +```bash +mkdir build +cmake .. +cmake --build . +``` + +Note that if you are building on Windows you must have Visual Studio installed and you must specify the +build generator explicitly: + +```bash +cmake -G "Visual Studio 15 2017 Win64" -T v140 .. +``` + +The reason for this is that if you do not specify Win64 it will default to 32-bit (which is incompatible +with the libraries in deps). The "-T v140" flag specifies that it should build with a VS2015 C++ compiler +(which is the same one the libraries are built with). + +If this complains about being unable to install a compiler and you do have Visual Studio installed, then +you will need to install Visual C++ support for VS2015. You can obtain the build tools from +https://www.visualstudio.com/ by signing up for the Microsoft Developer Essentials (it's free). +Note that you don't have to install the entirety of VS2015 (which is much larger). + +It *may* work correctly if you simply omit the "-T v140" flag, but we think that might be a bad idea +but are not entirely sure. + +Note that you will see an awful lot of warnings. This is fine. As long as the build exits successfully, +try running the generated executable (in either Debug or Release in your build directory) on sample.frag +in the root of this project. If you get a pretty image called output.png then it has worked. \ No newline at end of file