Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Corrade and Magnum with prefixed CMake options #1797

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cmake/FindCorrade.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# components, which are:
#
# Containers - Containers library
# Interconnect - Interconnect library
# Main - Main library
# PluginManager - PluginManager library
# TestSuite - TestSuite library
# Utility - Utility library
Expand Down Expand Up @@ -590,7 +592,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages.
elseif(NOT _component IN_LIST _CORRADE_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT)
list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Corrade.")
list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled CORRADE_WITH_${_COMPONENT} when building Corrade.")
# Otherwise we have no idea. Better be silent than to print something
# misleading.
else()
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/FindMagnum.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages.
elseif(NOT _component IN_LIST _MAGNUM_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUM_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum.")
list(APPEND _MAGNUM_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum.")
# Otherwise we have no idea. Better be silent than to print something
# misleading.
else()
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/FindMagnumBindings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages.
elseif(NOT _component IN_LIST _MAGNUMBINDINGS_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum Bindings")
list(APPEND _MAGNUMBINDINGS_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum Bindings")
# Otherwise we have no idea. Better be silent than to print something
# misleading.
else()
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/FindMagnumIntegration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages.
elseif(NOT _component IN_LIST _MAGNUMINTEGRATION_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUMINTEGRATION_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum Integration.")
list(APPEND _MAGNUMINTEGRATION_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum Integration.")
# Otherwise we have no idea. Better be silent than to print something
# misleading.
else()
Expand Down
7 changes: 5 additions & 2 deletions src/cmake/FindMagnumPlugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# StbDxtImageConverter - BC1/BC3 image compressor using stb_dxt
# StbImageConverter - Image converter using stb_image_write
# StbImageImporter - Image importer using stb_image
# StbResizeImageConverter - Image resizing using stb_image_resize
# StbTrueTypeFont - TrueType font using stb_truetype
# StbVorbisAudioImporter - OGG audio importer using stb_vorbis
# StlImporter - STL importer
Expand Down Expand Up @@ -165,7 +166,8 @@ set(_MAGNUMPLUGINS_PLUGIN_COMPONENTS
OpenGexImporter PngImageConverter PngImporter PrimitiveImporter
SpirvToolsShaderConverter StanfordImporter StanfordSceneConverter
StbDxtImageConverter StbImageConverter StbImageImporter
StbTrueTypeFont StbVorbisAudioImporter StlImporter WebPImporter)
StbResizeImageConverter StbTrueTypeFont StbVorbisAudioImporter StlImporter
WebPImporter)
# Nothing is enabled by default right now
set(_MAGNUMPLUGINS_IMPLICITLY_ENABLED_COMPONENTS )

Expand Down Expand Up @@ -469,6 +471,7 @@ foreach(_component ${MagnumPlugins_FIND_COMPONENTS})
# StbDxtImageConverter has no dependencies
# StbImageConverter has no dependencies
# StbImageImporter has no dependencies
# StbResizeImageConverter has no dependencies
# StbTrueTypeFont has no dependencies
# StbVorbisAudioImporter has no dependencies
# StlImporter has no dependencies
Expand Down Expand Up @@ -547,7 +550,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages.
elseif(NOT _component IN_LIST _MAGNUMPLUGINS_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUMPLUGINS_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum Plugins.")
list(APPEND _MAGNUMPLUGINS_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum Plugins.")
# Otherwise we have no idea. Better be silent than to print something
# misleading.
else()
Expand Down
94 changes: 41 additions & 53 deletions src/cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}")
if(NOT USE_SYSTEM_MAGNUM)
# These are enabled by default but we don't need them right now -- disabling
# for slightly faster builds. If you need any of these, simply delete a line.
set(WITH_INTERCONNECT OFF CACHE BOOL "" FORCE)
set(CORRADE_WITH_INTERCONNECT OFF CACHE BOOL "" FORCE)
# Ensure Corrade should be built statically if Magnum is.
set(BUILD_PLUGINS_STATIC ON CACHE BOOL "" FORCE)
set(BUILD_STATIC ON CACHE BOOL "" FORCE)
set(BUILD_STATIC_PIC ON CACHE BOOL "" FORCE)
set(CORRADE_BUILD_PLUGINS_STATIC ON CACHE BOOL "" FORCE)
set(CORRADE_BUILD_STATIC ON CACHE BOOL "" FORCE)
set(CORRADE_BUILD_STATIC_PIC ON CACHE BOOL "" FORCE)
add_subdirectory("${DEPS_DIR}/corrade")
endif()
find_package(Corrade REQUIRED Utility)
Expand Down Expand Up @@ -190,38 +190,40 @@ endif()

# Magnum. Use a system package, if preferred.
if(NOT USE_SYSTEM_MAGNUM)
# Magnum is already set to be build statically when Corrade is above.
set(MAGNUM_BUILD_PLUGINS_STATIC ON CACHE BOOL "" FORCE)
set(MAGNUM_BUILD_STATIC ON CACHE BOOL "" FORCE)
set(MAGNUM_BUILD_STATIC_PIC ON CACHE BOOL "" FORCE)

# These are enabled by default but we don't need them right now -- disabling
# for slightly faster builds. If you need any of these, simply delete a line.
set(WITH_TEXT OFF CACHE BOOL "" FORCE)
set(WITH_TEXTURETOOLS OFF CACHE BOOL "" FORCE)
set(MAGNUM_WITH_TEXT OFF CACHE BOOL "" FORCE)
set(MAGNUM_WITH_TEXTURETOOLS OFF CACHE BOOL "" FORCE)

# These are not enabled by default but we need them
set(WITH_ANYSCENEIMPORTER ON CACHE BOOL "WITH_ANYSCENEIMPORTER" FORCE)
set(MAGNUM_WITH_ANYSCENEIMPORTER ON CACHE BOOL "" FORCE)
if(BUILD_ASSIMP_SUPPORT)
set(WITH_ASSIMPIMPORTER ON CACHE BOOL "WITH_ASSIMPIMPORTER" FORCE)
set(MAGNUM_WITH_ASSIMPIMPORTER ON CACHE BOOL "" FORCE)
endif()
set(WITH_GLTFIMPORTER ON CACHE BOOL "" FORCE)
set(WITH_ANYIMAGEIMPORTER ON CACHE BOOL "WITH_ANYIMAGEIMPORTER" FORCE)
set(WITH_ANYIMAGECONVERTER ON CACHE BOOL "WITH_ANYIMAGECONVERTER" FORCE)
set(WITH_PRIMITIVEIMPORTER ON CACHE BOOL "" FORCE)
set(WITH_STANFORDIMPORTER ON CACHE BOOL "" FORCE)
set(WITH_STBIMAGEIMPORTER ON CACHE BOOL "WITH_STBIMAGEIMPORTER" FORCE)
set(WITH_STBIMAGECONVERTER ON CACHE BOOL "WITH_STBIMAGECONVERTER" FORCE)
set(WITH_EMSCRIPTENAPPLICATION OFF CACHE BOOL "WITH_EMSCRIPTENAPPLICATION" FORCE)
set(WITH_GLFWAPPLICATION OFF CACHE BOOL "WITH_GLFWAPPLICATION" FORCE)
set(WITH_EIGEN ON CACHE BOOL "WITH_EIGEN" FORCE) # Eigen integration
set(WITH_IMGUI ON CACHE BOOL "WITH_IMGUI" FORCE) # ImGui integration
set(MAGNUM_WITH_GLTFIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_ANYIMAGEIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_ANYIMAGECONVERTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_PRIMITIVEIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_STANFORDIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_STBIMAGEIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_STBIMAGECONVERTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_EMSCRIPTENAPPLICATION OFF CACHE BOOL "" FORCE)
set(MAGNUM_WITH_GLFWAPPLICATION OFF CACHE BOOL "" FORCE)
set(MAGNUM_WITH_EIGEN ON CACHE BOOL "" FORCE) # Eigen integration
set(MAGNUM_WITH_IMGUI ON CACHE BOOL "" FORCE) # ImGui integration
if(BUILD_PYTHON_BINDINGS)
set(WITH_PYTHON ON CACHE BOOL "" FORCE) # Python bindings
set(MAGNUM_WITH_PYTHON ON CACHE BOOL "" FORCE) # Python bindings
endif()
# We only support WebGL2
if(CORRADE_TARGET_EMSCRIPTEN)
set(TARGET_GLES2 OFF CACHE BOOL "" FORCE)
set(MAGNUM_TARGET_GLES2 OFF CACHE BOOL "" FORCE)
endif()
if(BUILD_TEST)
set(WITH_OPENGLTESTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_OPENGLTESTER ON CACHE BOOL "" FORCE)
endif()

# Basis Universal. The repo is extremely huge and so instead of a Git
Expand All @@ -235,12 +237,12 @@ if(NOT USE_SYSTEM_MAGNUM)
CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -DBASISD_SUPPORT_BC7_MODE6_OPAQUE_ONLY=0 -DBASISD_SUPPORT_ATC=0 -DBASISD_SUPPORT_FXT1=0 -DBASISD_SUPPORT_PVRTC2=0"
)
set(WITH_BASISIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_BASISIMPORTER ON CACHE BOOL "" FORCE)

if(BUILD_BASIS_COMPRESSOR)
# ImageConverter tool for basis
set(WITH_IMAGECONVERTER ON CACHE BOOL "" FORCE)
set(WITH_BASISIMAGECONVERTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_IMAGECONVERTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_BASISIMAGECONVERTER ON CACHE BOOL "" FORCE)
endif()

# OpenEXR. Use a system package, if preferred.
Expand Down Expand Up @@ -279,20 +281,20 @@ if(NOT USE_SYSTEM_MAGNUM)
set(BUILD_TESTING ${_PREV_BUILD_TESTING})
unset(CMAKE_DEBUG_POSTFIX CACHE)

set(WITH_OPENEXRIMPORTER ON CACHE BOOL "" FORCE)
set(WITH_OPENEXRIMAGECONVERTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_OPENEXRIMPORTER ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_OPENEXRIMAGECONVERTER ON CACHE BOOL "" FORCE)
endif()

if(BUILD_WITH_BULLET)
# Build Magnum's BulletIntegration
set(WITH_BULLET ON CACHE BOOL "" FORCE)
set(MAGNUM_WITH_BULLET ON CACHE BOOL "" FORCE)
else()
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(MAGNUM_WITH_BULLET OFF CACHE BOOL "" FORCE)
endif()

if(BUILD_GUI_VIEWERS)
if(CORRADE_TARGET_EMSCRIPTEN)
set(WITH_EMSCRIPTENAPPLICATION ON CACHE BOOL "WITH_EMSCRIPTENAPPLICATION" FORCE)
set(MAGNUM_WITH_EMSCRIPTENAPPLICATION ON CACHE BOOL "" FORCE)
else()
if(NOT USE_SYSTEM_GLFW)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
Expand All @@ -301,36 +303,22 @@ if(NOT USE_SYSTEM_MAGNUM)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory("${DEPS_DIR}/glfw")
endif()
set(WITH_GLFWAPPLICATION ON CACHE BOOL "WITH_GLFWAPPLICATION" FORCE)
set(MAGNUM_WITH_GLFWAPPLICATION ON CACHE BOOL "" FORCE)
endif()
endif()
if(APPLE)
set(WITH_WINDOWLESSCGLAPPLICATION ON CACHE BOOL "WITH_WINDOWLESSCGLAPPLICATION"
FORCE
)
set(MAGNUM_WITH_WINDOWLESSCGLAPPLICATION ON CACHE BOOL "" FORCE)
elseif(WIN32)
set(WITH_WINDOWLESSWGLAPPLICATION ON CACHE BOOL "WITH_WINDOWLESSWGLAPPLICATION"
FORCE
)
set(MAGNUM_WITH_WINDOWLESSWGLAPPLICATION ON CACHE BOOL "" FORCE)
elseif(CORRADE_TARGET_EMSCRIPTEN)
set(WITH_WINDOWLESSEGLAPPLICATION ON CACHE INTERNAL "WITH_WINDOWLESSEGLAPPLICATION"
FORCE
)
set(MAGNUM_WITH_WINDOWLESSEGLAPPLICATION ON CACHE INTERNAL "" FORCE)
elseif(UNIX)
if(BUILD_GUI_VIEWERS)
set(WITH_WINDOWLESSGLXAPPLICATION ON CACHE INTERNAL
"WITH_WINDOWLESSGLXAPPLICATION" FORCE
)
set(WITH_WINDOWLESSEGLAPPLICATION OFF CACHE INTERNAL
"WITH_WINDOWLESSEGLAPPLICATION" FORCE
)
set(MAGNUM_WITH_WINDOWLESSGLXAPPLICATION ON CACHE INTERNAL "" FORCE)
set(MAGNUM_WITH_WINDOWLESSEGLAPPLICATION OFF CACHE INTERNAL "" FORCE)
else()
set(WITH_WINDOWLESSGLXAPPLICATION OFF CACHE INTERNAL
"WITH_WINDOWLESSGLXAPPLICATION" FORCE
)
set(WITH_WINDOWLESSEGLAPPLICATION ON CACHE INTERNAL
"WITH_WINDOWLESSEGLAPPLICATION" FORCE
)
set(MAGNUM_WITH_WINDOWLESSGLXAPPLICATION OFF CACHE INTERNAL "" FORCE)
set(MAGNUM_WITH_WINDOWLESSEGLAPPLICATION ON CACHE INTERNAL "" FORCE)
endif()
endif()
add_subdirectory("${DEPS_DIR}/magnum")
Expand Down
2 changes: 1 addition & 1 deletion src/deps/corrade
Submodule corrade updated 129 files
2 changes: 1 addition & 1 deletion src/deps/magnum
Submodule magnum updated 237 files
2 changes: 1 addition & 1 deletion src/deps/magnum-integration
Submodule magnum-integration updated 41 files
+116 −23 CMakeLists.txt
+22 −22 doc/building-integration.dox
+9 −1 doc/changelog-integration.dox
+1 −1 doc/cmake-integration.dox
+19 −19 doc/namespaces.dox
+6 −6 doc/snippets/CMakeLists.txt
+3 −1 modules/FindCorrade.cmake
+5 −1 modules/FindMagnum.cmake
+1 −1 modules/FindMagnumIntegration.cmake
+32 −6 modules/FindMagnumPlugins.cmake
+7 −7 package/archlinux/PKGBUILD
+7 −7 package/archlinux/PKGBUILD-coverage
+6 −6 package/archlinux/PKGBUILD-emscripten
+6 −6 package/archlinux/PKGBUILD-emscripten-wasm
+6 −6 package/archlinux/PKGBUILD-emscripten-wasm-webgl2
+14 −14 package/archlinux/PKGBUILD-release
+5 −5 package/archlinux/magnum-integration-git/PKGBUILD
+32 −32 package/ci/android-x86-gles.sh
+27 −27 package/ci/appveyor-desktop-gles.bat
+24 −24 package/ci/appveyor-desktop-mingw.bat
+23 −23 package/ci/appveyor-desktop.bat
+28 −28 package/ci/appveyor-rt.bat
+4 −28 package/ci/circleci.yml
+30 −30 package/ci/emscripten.sh
+35 −35 package/ci/ios-simulator-gles.sh
+27 −27 package/ci/unix-desktop-gles.sh
+28 −28 package/ci/unix-desktop.sh
+4 −4 package/debian/rules
+5 −5 package/gentoo/dev-libs/magnum-integration/magnum-integration-9999.ebuild
+9 −5 package/homebrew/magnum-integration.rb
+3 −3 package/msys/PKGBUILD
+3 −3 package/msys/magnum-integration/PKGBUILD
+6 −6 src/Magnum/BulletIntegration/CMakeLists.txt
+7 −7 src/Magnum/CMakeLists.txt
+4 −4 src/Magnum/DartIntegration/CMakeLists.txt
+1 −1 src/Magnum/DartIntegration/Test/CMakeLists.txt
+1 −1 src/Magnum/EigenIntegration/CMakeLists.txt
+4 −4 src/Magnum/GlmIntegration/CMakeLists.txt
+4 −4 src/Magnum/ImGuiIntegration/CMakeLists.txt
+1 −1 src/Magnum/ImGuiIntegration/Test/CMakeLists.txt
+4 −4 src/Magnum/OvrIntegration/CMakeLists.txt
2 changes: 1 addition & 1 deletion src/deps/magnum-plugins
Submodule magnum-plugins updated 197 files
4 changes: 2 additions & 2 deletions src/esp/assets/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2427,8 +2427,8 @@ Mn::Image2D ResourceManager::convertRGBToSemanticId(
Mn::Image2D resImage{
Mn::PixelFormat::R16UI, size,
Cr::Containers::Array<char>{
Mn::NoInit,
std::size_t(size.product() * pixelSize(Mn::PixelFormat::R16UI))}};
Mn::NoInit, std::size_t(size.product() *
pixelFormatSize(Mn::PixelFormat::R16UI))}};

Cr::Containers::StridedArrayView2D<const Mn::Color3ub> input =
srcImage.pixels<Mn::Color3ub>();
Expand Down