Simplified macOS Build Process (#579)

This makes the default xcode project generated by premake work out of the box, and is generally easier for mac users.  Especially those who don't have permissions to modify /Library/Frameworks/

- Look for SDL in RecastDemo/Bin by default rather than /Library/Frameworks/
- Updated README build instructions
- Ignore SDL2.framework in RecastDemo/Bin
This commit is contained in:
Graham Pentheny 2022-11-11 21:04:29 -05:00 committed by GitHub
parent 5111139558
commit 17a19d0e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 23 deletions

View File

@ -24,20 +24,12 @@ the regions as simple polygons.
2. The walkable areas described by the mold are divided into simple overlayed 2D regions. The resulting regions have only one non-overlapping contour, which simplifies the final step of the process tremendously. 2. The walkable areas described by the mold are divided into simple overlayed 2D regions. The resulting regions have only one non-overlapping contour, which simplifies the final step of the process tremendously.
3. The navigation polygons are peeled off from the regions by first tracing the boundaries and then simplifying them. The resulting polygons are finally converted to convex polygons which makes them perfect for pathfinding and spatial reasoning about the level. 3. The navigation polygons are peeled off from the regions by first tracing the boundaries and then simplifying them. The resulting polygons are finally converted to convex polygons which makes them perfect for pathfinding and spatial reasoning about the level.
## Detour ## Detour
Recast is accompanied with Detour, path-finding and spatial reasoning toolkit. You can use any navigation mesh with Detour, but of course the data generated with Recast fits perfectly. Recast is accompanied with Detour, path-finding and spatial reasoning toolkit. You can use any navigation mesh with Detour, but of course the data generated with Recast fits perfectly.
Detour offers simple static navigation mesh which is suitable for many simple cases, as well as tiled navigation mesh which allows you to plug in and out pieces of the mesh. The tiled mesh allows you to create systems where you stream new navigation data in and out as the player progresses the level, or you may regenerate tiles as the world changes. Detour offers simple static navigation mesh which is suitable for many simple cases, as well as tiled navigation mesh which allows you to plug in and out pieces of the mesh. The tiled mesh allows you to create systems where you stream new navigation data in and out as the player progresses the level, or you may regenerate tiles as the world changes.
## Installation through vcpkg
If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install Recast with a single command:
```
vcpkg install recast
```
## Recast Demo ## Recast Demo
You can find a comprehensive demo project in RecastDemo folder. It is a kitchen sink demo containing all the functionality of the library. If you are new to Recast & Detour, check out [Sample_SoloMesh.cpp](/RecastDemo/Source/Sample_SoloMesh.cpp) to get started with building navmeshes and [NavMeshTesterTool.cpp](/RecastDemo/Source/NavMeshTesterTool.cpp) to see how Detour can be used to find paths. You can find a comprehensive demo project in RecastDemo folder. It is a kitchen sink demo containing all the functionality of the library. If you are new to Recast & Detour, check out [Sample_SoloMesh.cpp](/RecastDemo/Source/Sample_SoloMesh.cpp) to get started with building navmeshes and [NavMeshTesterTool.cpp](/RecastDemo/Source/NavMeshTesterTool.cpp) to see how Detour can be used to find paths.
@ -49,24 +41,23 @@ RecastDemo uses [premake5](http://premake.github.io/) to build platform specific
#### Linux #### Linux
- Install SDL2 and its dependencies according to your distro's guidelines. - Install SDL2 and its dependencies according to your distro's guidelines.
- run `premake5 gmake` from the `RecastDemo` folder. - Navigate to the `RecastDemo` folder and run `premake5 gmake2`
- `cd Build/gmake` then `make` - Navigate to `RecastDemo/Build/gmake2` and run `make`
- `cd RecastDemo/Bin` and then run `./RecastDemo` - Navigate to `RecastDemo/Bin` and run `./RecastDemo`
#### OSX #### macOS
- Grab the latest SDL2 development library dmg from [here](https://www.libsdl.org/download-2.0.php) and place `SDL2.framework` in `/Library/Frameworks/` - Grab the latest SDL2 development library dmg from [here](https://github.com/libsdl-org/SDL) and place `SDL2.framework` in `RecastDemo/Bin`
- Navigate to the `RecastDemo` folder and run `premake5 xcode4` - Navigate to the `RecastDemo` folder and run `premake5 xcode4`
- Open `Build/xcode4/recastnavigation.xcworkspace` - Open `Build/xcode4/recastnavigation.xcworkspace`
- Select the "RecastDemo" project in the left pane, go to the "BuildPhases" tab and expand "Link Binary With Libraries"
- Remove the existing entry for SDL2 (it should have a white box icon) and re-add it by hitting the plus, selecting "Add Other", and selecting `/Library/Frameworks/SDL2.framework`. It should now have a suitcase icon.
- Set the RecastDemo project as the target and build. - Set the RecastDemo project as the target and build.
#### Windows #### Windows
- Grab the latest SDL2 development library release from [here](https://www.libsdl.org/download-2.0.php) and unzip it `RecastDemo\Contrib`. Rename the SDL folder such that the path `RecastDemo\Contrib\SDL\lib\x86` is valid. - Grab the latest SDL2 development library release from [here](https://github.com/libsdl-org/SDL) and unzip it `RecastDemo\Contrib`. Rename the SDL folder such that the path `RecastDemo\Contrib\SDL\lib\x86` is valid.
- Run `"premake5" vs2019` from the `RecastDemo` folder - Navigate to the `RecastDemo` folder and run `premake5 vs2022`
- Open the solution, build, and run. - Open `Build/vs2022/recastnavigation.sln`.
- Set `RecastDemo` as the startup project, build, and run.
### Running Unit tests ### Running Unit tests
@ -78,6 +69,14 @@ RecastDemo uses [premake5](http://premake.github.io/) to build platform specific
It is recommended to add the source directories `DebugUtils`, `Detour`, `DetourCrowd`, `DetourTileCache`, and `Recast` into your own project depending on which parts of the project you need. For example your level building tool could include `DebugUtils`, `Recast`, and `Detour`, and your game runtime could just include `Detour`. It is recommended to add the source directories `DebugUtils`, `Detour`, `DetourCrowd`, `DetourTileCache`, and `Recast` into your own project depending on which parts of the project you need. For example your level building tool could include `DebugUtils`, `Recast`, and `Detour`, and your game runtime could just include `Detour`.
### Installation through vcpkg
If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install Recast with:
```
vcpkg install recast
```
## Contributing ## Contributing
See the [Contributing document](CONTRIBUTING.md) for guidelines for making contributions. See the [Contributing document](CONTRIBUTING.md) for guidelines for making contributions.

View File

@ -1 +1,2 @@
Recast.app Recast.app
SDL2.framework

View File

@ -188,7 +188,7 @@ project "RecastDemo"
-- mac includes and libs -- mac includes and libs
filter "system:macosx" filter "system:macosx"
kind "ConsoleApp" -- xcode4 failes to run the project if using WindowedApp kind "ConsoleApp" -- xcode4 failes to run the project if using WindowedApp
includedirs { "/Library/Frameworks/SDL2.framework/Headers" } includedirs { "Bin/SDL2.framework/Headers" }
links { links {
"OpenGL.framework", "OpenGL.framework",
"SDL2.framework", "SDL2.framework",
@ -268,9 +268,6 @@ project "Tests"
-- mac includes and libs -- mac includes and libs
filter "system:macosx" filter "system:macosx"
kind "ConsoleApp" kind "ConsoleApp"
includedirs { "/Library/Frameworks/SDL2.framework/Headers" }
links { links {
"OpenGL.framework",
"SDL2.framework",
"Cocoa.framework", "Cocoa.framework",
} }