Browse Source

Emscripten: ported FindOpenGLES2.cmake and FindSDL2.cmake.

SDL headers are now included relatively.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
c5c57e17da
  1. 14
      modules/FindOpenGLES2.cmake
  2. 15
      modules/FindSDL2.cmake
  3. 4
      src/Platform/Sdl2Application.h

14
modules/FindOpenGLES2.cmake

@ -31,10 +31,14 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
# Library # In Emscripten OpenGL ES 2 is linked automatically, thus no need to find the
find_library(OPENGLES2_LIBRARY NAMES # library.
GLESv2 if(NOT CORRADE_TARGET_EMSCRIPTEN)
ppapi_gles2) # NaCl find_library(OPENGLES2_LIBRARY NAMES
GLESv2
ppapi_gles2) # NaCl
set(OPENGLES2_LIBRARY_NEEDED OPENGLES2_LIBRARY)
endif()
# Include dir # Include dir
find_path(OPENGLES2_INCLUDE_DIR find_path(OPENGLES2_INCLUDE_DIR
@ -44,6 +48,6 @@ find_path(OPENGLES2_INCLUDE_DIR
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args("OpenGLES2" DEFAULT_MSG find_package_handle_standard_args("OpenGLES2" DEFAULT_MSG
OPENGLES2_LIBRARY ${OPENGLES2_LIBRARY_NEEDED}
OPENGLES2_INCLUDE_DIR OPENGLES2_INCLUDE_DIR
) )

15
modules/FindSDL2.cmake

@ -31,17 +31,24 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
# Library # In Emscripten SDL is linked automatically, thus no need to find the library.
find_library(SDL2_LIBRARY SDL2) # Also the includes are in SDL subdirectory, not SDL2.
if(CORRADE_TARGET_EMSCRIPTEN)
set(PATH_SUFFIXES SDL)
else()
find_library(SDL2_LIBRARY SDL2)
set(SDL2_LIBRARY_NEEDED SDL2_LIBRARY)
set(PATH_SUFFIXES SDL2)
endif()
# Include dir # Include dir
find_path(SDL2_INCLUDE_DIR find_path(SDL2_INCLUDE_DIR
NAMES SDL.h SDL_scancode.h NAMES SDL.h SDL_scancode.h
PATH_SUFFIXES SDL2 PATH_SUFFIXES ${PATH_SUFFIXES}
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args("SDL2" DEFAULT_MSG find_package_handle_standard_args("SDL2" DEFAULT_MSG
SDL2_LIBRARY ${SDL2_LIBRARY_NEEDED}
SDL2_INCLUDE_DIR SDL2_INCLUDE_DIR
) )

4
src/Platform/Sdl2Application.h

@ -34,8 +34,8 @@
#ifdef _WIN32 /* Windows version of SDL2 redefines main(), we don't want that */ #ifdef _WIN32 /* Windows version of SDL2 redefines main(), we don't want that */
#define SDL_MAIN_HANDLED #define SDL_MAIN_HANDLED
#endif #endif
#include <SDL2/SDL.h> #include <SDL.h>
#include <SDL2/SDL_scancode.h> #include <SDL_scancode.h>
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
namespace Magnum { namespace Magnum {

Loading…
Cancel
Save