4 changed files with 307 additions and 1 deletions
@ -0,0 +1,86 @@
|
||||
#.rst: |
||||
# Find OpenGL ES 2 |
||||
# ---------------- |
||||
# |
||||
# Finds the OpenGL ES 2 library. This module defines: |
||||
# |
||||
# OpenGLES2_FOUND - True if OpenGL ES 2 library is found |
||||
# OpenGLES2::OpenGLES2 - OpenGL ES 2 imported target |
||||
# |
||||
# Additionally these variables are defined for internal usage: |
||||
# |
||||
# OPENGLES2_LIBRARY - OpenGL ES 2 library |
||||
# OPENGLES2_INCLUDE_DIR - Include dir |
||||
# |
||||
|
||||
# |
||||
# This file is part of Magnum. |
||||
# |
||||
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 |
||||
# Vladimír Vondruš <mosra@centrum.cz> |
||||
# |
||||
# Permission is hereby granted, free of charge, to any person obtaining a |
||||
# copy of this software and associated documentation files (the "Software"), |
||||
# to deal in the Software without restriction, including without limitation |
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
# and/or sell copies of the Software, and to permit persons to whom the |
||||
# Software is furnished to do so, subject to the following conditions: |
||||
# |
||||
# The above copyright notice and this permission notice shall be included |
||||
# in all copies or substantial portions of the Software. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
# DEALINGS IN THE SOFTWARE. |
||||
# |
||||
|
||||
# In Emscripten OpenGL ES 2 is linked automatically, thus no need to find the |
||||
# library. |
||||
if(NOT CORRADE_TARGET_EMSCRIPTEN) |
||||
find_library(OPENGLES2_LIBRARY NAMES |
||||
GLESv2 |
||||
|
||||
# ANGLE (CMake doesn't search for lib prefix on Windows) |
||||
libGLESv2 |
||||
|
||||
# iOS |
||||
OpenGLES) |
||||
set(OPENGLES2_LIBRARY_NEEDED OPENGLES2_LIBRARY) |
||||
endif() |
||||
|
||||
# Include dir |
||||
find_path(OPENGLES2_INCLUDE_DIR NAMES |
||||
GLES2/gl2.h |
||||
|
||||
# iOS |
||||
ES2/gl.h) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG |
||||
${OPENGLES2_LIBRARY_NEEDED} |
||||
OPENGLES2_INCLUDE_DIR) |
||||
|
||||
if(NOT TARGET OpenGLES2::OpenGLES2) |
||||
if(OPENGLES2_LIBRARY_NEEDED) |
||||
# Work around BUGGY framework support on macOS |
||||
# http://public.kitware.com/pipermail/cmake/2016-April/063179.html |
||||
if(CORRADE_TARGET_APPLE AND ${OPENGLES2_LIBRARY} MATCHES "\\.framework$") |
||||
add_library(OpenGLES2::OpenGLES2 INTERFACE IMPORTED) |
||||
set_property(TARGET OpenGLES2::OpenGLES2 APPEND PROPERTY |
||||
INTERFACE_LINK_LIBRARIES ${OPENGLES2_LIBRARY}) |
||||
else() |
||||
add_library(OpenGLES2::OpenGLES2 UNKNOWN IMPORTED) |
||||
set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY |
||||
IMPORTED_LOCATION ${OPENGLES2_LIBRARY}) |
||||
endif() |
||||
else() |
||||
add_library(OpenGLES2::OpenGLES2 INTERFACE IMPORTED) |
||||
endif() |
||||
|
||||
set_property(TARGET OpenGLES2::OpenGLES2 PROPERTY |
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES2_INCLUDE_DIR}) |
||||
endif() |
||||
@ -0,0 +1,100 @@
|
||||
#.rst: |
||||
# Find OpenGL ES 3 |
||||
# ---------------- |
||||
# |
||||
# Finds the OpenGL ES 3 library. This module defines: |
||||
# |
||||
# OpenGLES3_FOUND - True if OpenGL ES 3 library is found |
||||
# OpenGLES3::OpenGLES3 - OpenGL ES 3 imported target |
||||
# |
||||
# Additionally these variables are defined for internal usage: |
||||
# |
||||
# OPENGLES3_LIBRARY - OpenGL ES 3 library |
||||
# OPENGLES3_INCLUDE_DIR - Include dir |
||||
# |
||||
|
||||
# |
||||
# This file is part of Magnum. |
||||
# |
||||
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 |
||||
# Vladimír Vondruš <mosra@centrum.cz> |
||||
# |
||||
# Permission is hereby granted, free of charge, to any person obtaining a |
||||
# copy of this software and associated documentation files (the "Software"), |
||||
# to deal in the Software without restriction, including without limitation |
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
# and/or sell copies of the Software, and to permit persons to whom the |
||||
# Software is furnished to do so, subject to the following conditions: |
||||
# |
||||
# The above copyright notice and this permission notice shall be included |
||||
# in all copies or substantial portions of the Software. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
# DEALINGS IN THE SOFTWARE. |
||||
# |
||||
|
||||
# In Emscripten OpenGL ES 3 is linked automatically, thus no need to find the |
||||
# library. |
||||
if(NOT CORRADE_TARGET_EMSCRIPTEN) |
||||
find_library(OPENGLES3_LIBRARY NAMES |
||||
GLESv3 |
||||
|
||||
# On some platforms (e.g. desktop emulation with Mesa or NVidia) ES3 |
||||
# support is provided in ES2 lib |
||||
GLESv2 |
||||
|
||||
# ANGLE (CMake doesn't search for lib prefix on Windows) |
||||
libGLESv2 |
||||
|
||||
# iOS |
||||
OpenGLES) |
||||
set(OPENGLES3_LIBRARY_NEEDED OPENGLES3_LIBRARY) |
||||
endif() |
||||
|
||||
# Include dir |
||||
find_path(OPENGLES3_INCLUDE_DIR NAMES |
||||
GLES3/gl3.h |
||||
|
||||
# iOS |
||||
ES3/gl.h) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
find_package_handle_standard_args("OpenGLES3" DEFAULT_MSG |
||||
${OPENGLES3_LIBRARY_NEEDED} |
||||
OPENGLES3_INCLUDE_DIR) |
||||
|
||||
if(NOT TARGET OpenGLES3::OpenGLES3) |
||||
if(OPENGLES3_LIBRARY_NEEDED) |
||||
# Work around BUGGY framework support on macOS |
||||
# http://public.kitware.com/pipermail/cmake/2016-April/063179.html |
||||
if(CORRADE_TARGET_APPLE AND ${OPENGLES3_LIBRARY} MATCHES "\\.framework$") |
||||
add_library(OpenGLES3::OpenGLES3 INTERFACE IMPORTED) |
||||
set_property(TARGET OpenGLES3::OpenGLES3 APPEND PROPERTY |
||||
INTERFACE_LINK_LIBRARIES ${OPENGLES3_LIBRARY}) |
||||
else() |
||||
add_library(OpenGLES3::OpenGLES3 UNKNOWN IMPORTED) |
||||
set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY |
||||
IMPORTED_LOCATION ${OPENGLES3_LIBRARY}) |
||||
endif() |
||||
else() |
||||
add_library(OpenGLES3::OpenGLES3 INTERFACE IMPORTED) |
||||
endif() |
||||
|
||||
set_property(TARGET OpenGLES3::OpenGLES3 PROPERTY |
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPENGLES3_INCLUDE_DIR}) |
||||
|
||||
# Emscripten needs a special flag to use WebGL 2. CMake 3.13 allows to set |
||||
# this via INTERFACE_LINK_OPTIONS, for older versions we modify the global |
||||
# CMAKE_EXE_LINKER_FLAGS inside FindMagnum.cmake. |
||||
if(CORRADE_TARGET_EMSCRIPTEN AND NOT CMAKE_VERSION VERSION_LESS 3.13) |
||||
# I could probably use target_link_options() here, but let's be |
||||
# consistent with the rest |
||||
set_property(TARGET OpenGLES3::OpenGLES3 APPEND PROPERTY |
||||
INTERFACE_LINK_OPTIONS "SHELL:-s USE_WEBGL2=1") |
||||
endif() |
||||
endif() |
||||
@ -0,0 +1,76 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps/lib \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DBUILD_DEPRECATED=$BUILD_DEPRECATED \ |
||||
-DWITH_INTERCONNECT=OFF \ |
||||
-DWITH_PLUGINMANAGER=OFF \ |
||||
-DWITH_TESTSUITE=OFF \ |
||||
-G Ninja |
||||
ninja install |
||||
cd ../.. |
||||
|
||||
# Magnum |
||||
git clone --depth 1 git://github.com/mosra/magnum.git |
||||
cd magnum |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps/lib \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DEGL_LIBRARY=$HOME/swiftshader/libEGL.so \ |
||||
-DOPENGLES2_LIBRARY=$HOME/swiftshader/libGLESv2.so \ |
||||
-DOPENGLES3_LIBRARY=$HOME/swiftshader/libGLESv2.so \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/swiftshader \ |
||||
-DTARGET_GLES=ON \ |
||||
-DTARGET_GLES2=$TARGET_GLES2 \ |
||||
-DWITH_AUDIO=OFF \ |
||||
-DWITH_DEBUGTOOLS=OFF \ |
||||
-DWITH_GL=ON \ |
||||
-DWITH_MESHTOOLS=OFF \ |
||||
-DWITH_PRIMITIVES=OFF \ |
||||
-DWITH_SCENEGRAPH=ON \ |
||||
-DWITH_SHADERS=ON \ |
||||
-DWITH_TEXT=OFF \ |
||||
-DWITH_TEXTURETOOLS=OFF \ |
||||
-DWITH_TRADE=OFF \ |
||||
-DWITH_VK=OFF \ |
||||
-DWITH_WINDOWLESSEGLAPPLICATION=ON \ |
||||
-DBUILD_DEPRECATED=OFF \ |
||||
-G Ninja |
||||
ninja install |
||||
cd ../.. |
||||
|
||||
# Build the thing |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_CXX_FLAGS="--coverage" \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_BUILD_TYPE=Debug \ |
||||
-DCMAKE_PREFIX_PATH=$HOME/pybind11 \ |
||||
-DEGL_LIBRARY=$HOME/swiftshader/libEGL.so \ |
||||
-DOPENGLES2_LIBRARY=$HOME/swiftshader/libGLESv2.so \ |
||||
-DOPENGLES3_LIBRARY=$HOME/swiftshader/libGLESv2.so \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/swiftshader \ |
||||
-DPYBIND11_PYTHON_VERSION=3.6 \ |
||||
-DWITH_PYTHON=ON \ |
||||
-G Ninja |
||||
ninja |
||||
|
||||
# Verify the setuptools install |
||||
cd src/python |
||||
python3 setup.py install --root="$TRAVIS_BUILD_DIR/install" --prefix=/usr |
||||
|
||||
# Run tests & gather coverage |
||||
cd ../../../src/python/corrade |
||||
coverage run -m unittest -v && cp .coverage ../.coverage.corrade |
||||
|
||||
cd ../magnum |
||||
coverage run -m unittest -v && cp .coverage ../.coverage.magnum |
||||
Loading…
Reference in new issue