Merge COMPILING into README;

This commit is contained in:
bjorn 2016-10-24 14:15:39 -07:00
parent 222b7d1e19
commit e31ca5e812
2 changed files with 72 additions and 79 deletions

View File

@ -35,4 +35,75 @@ Support for other hardware will happen eventually.
Compiling
---
See the [compilation guide](doc/COMPILING.md).
How to compile LÖVR from source.
### Dependencies
- LuaJIT
- GLFW (3.2+)
- OpenGL (Unix) or GLEW (Windows)
- assimp (for `lovr.model` and `lovr.graphics.newModel`)
- OpenVR (for `lovr.headset`)
#### Windows (CMake)
First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps):
```sh
cd lovr
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
```
Next, use CMake to generate the build files:
```sh
mkdir build
cd build
cmake ..
```
This should output a Visual Studio solution, which can be built using Visual Studio. Or you can
just build it with CMake:
```sh
cmake --build .
```
The executable will then exist at `/path/to/lovr/build/Debug/lovr.exe`. The recommended way to
create and run a game from this point is:
- Create a shortcut to the `lovr.exe` executable somewhere convenient.
- Create a folder for your game: `MySuperAwesomeGame`.
- Create a `main.lua` file in the folder and put your code in there.
- Drag the `MySuperAwesomeGame` folder onto the shortcut to `lovr.exe`.
#### Unix (CMake)
First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone
`openvr` into the same directory that `lovr` was cloned into. Next, install the other dependencies
above using your package manager of choice:
```sh
brew install assimp glfw3 luajit
```
On OSX, you'll need to set the `DYLD_LIBRARY_PATH` environment variable to be
`/path/to/openvr/lib/osx32`.
Next, build using CMake:
```sh
mkdir build
cd build
cmake .. -DOPENVR_DIR=../../openvr
cmake --build .
```
The `lovr` executable should exist in `lovr/build` now. You can run a game like this:
```sh
./lovr /path/to/myGame
```
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.

View File

@ -1,78 +0,0 @@
Compiling
===
How to compile LÖVR from source.
Dependencies
---
- LuaJIT
- GLFW (3.2+)
- OpenGL (Unix) or GLEW (Windows)
- assimp (for `lovr.model` and `lovr.graphics.newModel`)
- OpenVR (for `lovr.headset`)
Windows (CMake)
---
First, install [lovr-deps](https://github.com/bjornbytes/lovr-deps):
```sh
cd lovr
git clone --recursive https://github.com/bjornbytes/lovr-deps deps
```
Next, use CMake to generate the build files:
```sh
mkdir build
cd build
cmake ..
```
This should output a Visual Studio solution, which can be built using Visual Studio. Or you can
just build it with CMake:
```sh
cmake --build .
```
The executable will then exist at `/path/to/lovr/build/Debug/lovr.exe`. The recommended way to
create and run a game from this point is:
- Create a shortcut to the `lovr.exe` executable somewhere convenient.
- Create a folder for your game: `MySuperAwesomeGame`.
- Create a `main.lua` file in the folder and put your code in there.
- Drag the `MySuperAwesomeGame` folder onto the shortcut to `lovr.exe`.
Unix (CMake)
---
First, clone [OpenVR](https://github.com/ValveSoftware/openvr). For this example, we'll clone
`openvr` into the same directory that `lovr` was cloned into. Next, install the other dependencies
above using your package manager of choice:
```sh
brew install assimp glfw3 luajit
```
On OSX, you'll need to set the `DYLD_LIBRARY_PATH` environment variable to be
`/path/to/openvr/lib/osx32`.
Next, build using CMake:
```sh
mkdir build
cd build
cmake .. -DOPENVR_DIR=../../openvr
cmake --build .
```
The `lovr` executable should exist in `lovr/build` now. You can run a game like this:
```sh
./lovr /path/to/myGame
```
You can also copy or symlink LÖVR into a directory on your `PATH` environment variable (e.g.
`/usr/local/bin`) and run games from anywhere by just typing `lovr`.