Merge pull request #1235 from sigman78/master

[Magnum] OpengGL 3d library port
This commit is contained in:
Robert Schumacher 2017-06-28 13:29:52 -07:00 committed by GitHub
commit 47d8d72316
9 changed files with 293 additions and 0 deletions

3
ports/corrade/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: corrade
Version: jun2017-2
Description: C++11/C++14 multiplatform utility library http://mosra.cz/blog/corrade.php

View File

@ -0,0 +1,47 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/corrade
REF c182fe636894a998f241212d0205d0c126b7926f
SHA512 e62486368eab9c5f90ef9f4af91500f465d9e3baa6e5f6e9f2a49844d09676faefcb965a9d5b27a54eda19436af6b23dcda19504be6cd0dcd52dfad2ad4bfa21
HEAD_REF master
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
else()
set(BUILD_STATIC 0)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS -DBUILD_STATIC=${BUILD_STATIC}
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Drop a copy of tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade)
# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade)
file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${TO_REMOVE})
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/corrade)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/corrade/COPYING ${CURRENT_PACKAGES_DIR}/share/corrade/copyright)
vcpkg_copy_pdbs()

View File

@ -0,0 +1,26 @@
diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake
index e63bc03..052006f 100644
--- a/modules/FindCorrade.cmake
+++ b/modules/FindCorrade.cmake
@@ -397,7 +397,7 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
if(_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS})
add_executable(Corrade::${_component} IMPORTED)
- find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component})
+ find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component} PATH_SUFFIXES corrade)
mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE)
if(CORRADE_${_COMPONENT}_EXECUTABLE)
diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake
index 8df555d..12f7aa4 100644
--- a/modules/FindMagnum.cmake
+++ b/modules/FindMagnum.cmake
@@ -493,7 +493,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
if(_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS})
add_executable(Magnum::${_component} IMPORTED)
- find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component})
+ find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component} PATH_SUFFIXES magnum)
mark_as_advanced(MAGNUM_${_COMPONENT}_EXECUTABLE)
if(MAGNUM_${_COMPONENT}_EXECUTABLE)

View File

@ -0,0 +1,4 @@
Source: magnum-plugins
Version: jun2017-4
Build-Depends: stb, magnum
Description: Plugins for C++11/C++14 and OpenGL graphics engine http://mosra.cz/blog/magnum.php

View File

@ -0,0 +1,75 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/magnum-plugins
REF 34a3bc34335ca05097e735db19fe1fae81dbfbb5
SHA512 918c3eeae246d1ac67e3595c50ff599872a0c1498e9a8a0386ad656f3d9d2209b048b53c25f198660e15201147795578c5c931b00116da46fd77d8e91c0826cb
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/001-tools-path.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
set(BUILD_PLUGINS_STATIC 1)
else()
set(BUILD_STATIC 0)
set(BUILD_PLUGINS_STATIC 0)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
-DWITH_STBIMAGECONVERTER=ON
-DWITH_STBIMAGEIMPORTER=ON
-DWITH_STBTRUETYPEFONT=ON
-DWITH_STBTRUETYPEFONT=ON
-DWITH_MINIEXRIMAGECONVERTER=ON
-DWITH_OPENGEXIMPORTER=ON
-DWITH_OPENGEXIMPORTER=ON
-DWITH_STANFORDIMPORTER=ON
-DWITH_DRWAVAUDIOIMPORTER=ON
-DWITH_ANYAUDIOIMPORTER=ON
-DWITH_ANYIMAGECONVERTER=ON
-DWITH_ANYSCENEIMPORTER=ON
-DBUILD_STATIC=${BUILD_STATIC}
-DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC}
-DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d
-DMAGNUM_PLUGINS_RELEASE_DIR=${CURRENT_INSTALLED_DIR}/bin/magnum
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
# move plugin libs to conventional place
file(GLOB_RECURSE LIB_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
file(COPY ${LIB_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
file(GLOB_RECURSE LIB_TO_MOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum/*)
file(COPY ${LIB_TO_MOVE_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum)
else()
# remove headers and libs for plugins
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib)
# hint vcpkg
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
endif()
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-plugins)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/copyright)
vcpkg_copy_pdbs()

View File

@ -0,0 +1,20 @@
diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h
index 99c3174..311b2c1 100644
--- a/src/Magnum/Platform/Sdl2Application.h
+++ b/src/Magnum/Platform/Sdl2Application.h
@@ -42,11 +42,11 @@
#ifdef CORRADE_TARGET_WINDOWS /* Windows version of SDL2 redefines main(), we don't want that */
#define SDL_MAIN_HANDLED
#endif
-#include <SDL.h>
-#include <SDL_scancode.h>
+#include <SDL2/SDL.h>
+#include <SDL2/SDL_scancode.h>
#ifdef CORRADE_TARGET_WINDOWS_RT
-#include <SDL_main.h> /* For SDL_WinRTRunApp */
+#include <SDL2/SDL_main.h> /* For SDL_WinRTRunApp */
#include <wrl.h> /* For the WinMain entrypoint */
#endif

View File

@ -0,0 +1,26 @@
diff --git a/modules/FindCorrade.cmake b/modules/FindCorrade.cmake
index e63bc03..052006f 100644
--- a/modules/FindCorrade.cmake
+++ b/modules/FindCorrade.cmake
@@ -397,7 +397,7 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
if(_component MATCHES ${_CORRADE_EXECUTABLE_COMPONENTS})
add_executable(Corrade::${_component} IMPORTED)
- find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component})
+ find_program(CORRADE_${_COMPONENT}_EXECUTABLE corrade-${_component} PATH_SUFFIXES corrade)
mark_as_advanced(CORRADE_${_COMPONENT}_EXECUTABLE)
if(CORRADE_${_COMPONENT}_EXECUTABLE)
diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake
index 8df555d..12f7aa4 100644
--- a/modules/FindMagnum.cmake
+++ b/modules/FindMagnum.cmake
@@ -493,7 +493,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
if(_component MATCHES ${_MAGNUM_EXECUTABLE_COMPONENTS})
add_executable(Magnum::${_component} IMPORTED)
- find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component})
+ find_program(MAGNUM_${_COMPONENT}_EXECUTABLE magnum-${_component} PATH_SUFFIXES magnum)
mark_as_advanced(MAGNUM_${_COMPONENT}_EXECUTABLE)
if(MAGNUM_${_COMPONENT}_EXECUTABLE)

4
ports/magnum/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: magnum
Version: jun2017-5
Build-Depends: corrade, sdl2, openal-soft
Description: C++11/C++14 and OpenGL graphics engine http://mosra.cz/blog/magnum.php

View File

@ -0,0 +1,88 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/magnum
REF ed7eac0b42a598dff8984830e7f943dd6af07deb
SHA512 843e209b82b4f6f7c3f9612aec2641a28cb09361eefefe435bb7d2c06d0e4df65b6b9adf5893222cf31ddc3ccec967eb343da1da6180e9fbfef1b26234e145d5
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/001-sdl-includes.patch
${CMAKE_CURRENT_LIST_DIR}/002-tools-path.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
set(BUILD_PLUGINS_STATIC 1)
else()
set(BUILD_STATIC 0)
set(BUILD_PLUGINS_STATIC 0)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
-DWITH_SDL2APPLICATION=ON
-DWITH_WINDOWLESSWGLAPPLICATION=ON
-DWITH_WGLCONTEXT=ON
-DWITH_OPENGLTESTER=ON
-DWITH_AUDIO=ON
-DWITH_WAVAUDIOIMPORTER=ON
-DWITH_MAGNUMFONT=ON
-DWITH_MAGNUMFONTCONVERTER=ON
-DWITH_OBJIMPORTER=ON
-DWITH_TGAIMPORTER=ON
-DWITH_DISTANCEFIELDCONVERTER=ON
-DWITH_FONTCONVERTER=ON
-DWITH_TGAIMAGECONVERTER=ON
-DBUILD_STATIC=${BUILD_STATIC}
-DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC}
-DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d
-DMAGNUM_PLUGINS_RELEASE_DIR=${CURRENT_INSTALLED_DIR}/bin/magnum
--trace
)
vcpkg_install_cmake()
# Drop a copy of tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-distancefieldconverter.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-fontconverter.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/magnum)
file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${TO_REMOVE})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
# move plugin libs to conventional place
file(GLOB_RECURSE LIB_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
file(COPY ${LIB_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
file(GLOB_RECURSE LIB_TO_MOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum/*)
file(COPY ${LIB_TO_MOVE_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum)
else()
# remove headers and libs for plugins
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/MagnumPlugins)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum-d)
endif()
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum/copyright)
vcpkg_copy_pdbs()