widberg / bgfx.cmake

https://github.com/bkaradzic/bgfx.cmake. Independently maintained CMake build scripts for bgfx. Released under public domain.
https://github.com/bkaradzic/bgfx.cmake
Creative Commons Zero v1.0 Universal
286 stars 254 forks source link

Added support for SDL and GLFW #25

Closed leokolln closed 6 years ago

leokolln commented 6 years ago

Implemented the equivalent of --with-sdl and --with-glfw.

Usage:

cmake -DBGFX_WITH_SDL=TRUE ..

or

cmake -DBGFX_WITH_GLFW=TRUE ..

Only tested on Ubuntu 18.04, relevant packages versions:

Package: libsdl2-dev
Version: 2.0.8+dfsg1-1ubuntu1.18.04.1

Package: libglfw3-dev
Version: 3.2.1-1

Package: cmake
Version: 3.10.2-1ubuntu2
JoshuaBrookover commented 6 years ago

I'm not able to test Windows right now but I'm not seeing any reason why the change list should cause issues, especially since its opt-in.

Tested on OSX. GLFW works great, SDL2 has issues as you suspected. Unfortunately I don't think there's anything I can do about SDL2 when installed as a framework. BGFX's entry includes SDL2 as <SDL2/SDL.h> but in the OSX framework the "SDL2" folder doesn't exist.

People will have to manually fix this themselves if they plan to use SDL2, which should be easy enough, so I'll go ahead and merge in. Thanks!