Skip to content

Commit

Permalink
(#7272) [magnum-plugins] Add recipe
Browse files Browse the repository at this point in the history
* [magnum-plugins] Add recipes

* rename options to snake_case

* disable gcc5, use '-d' suffix

* gcc5 is covered by magnum itself

* use short_paths

* add test: load STL file

* use forward slashes

* handle use-case when shared_plugins=False

* parameterize plugins components

* update comment

* add endline

* DLLs in Windows are located in 'bin'  folder

* auto import only if not shared plugins

* follow suggestions by @SSE4

* Works with Emscripten
  • Loading branch information
jgsogo authored Sep 28, 2021
1 parent 48ad904 commit a73311d
Show file tree
Hide file tree
Showing 11 changed files with 498 additions and 0 deletions.
41 changes: 41 additions & 0 deletions recipes/magnum-plugins/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.1)
project(cmake_wrapper)

set(CONAN_CMAKE_SILENT_OUTPUT 1)

include(conanbuildinfo.cmake)
conan_basic_setup()

# The original project uses the path to the 'magnum' package, in Conan we cannot modify existing package
set(MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/magnum-d)
set(MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/magnum-d)
set(MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/magnum)
set(MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/magnum)
set(MAGNUM_PLUGINS_FONT_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/fonts)
set(MAGNUM_PLUGINS_FONT_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/fonts)
set(MAGNUM_PLUGINS_FONT_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/fonts)
set(MAGNUM_PLUGINS_FONT_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/fonts)
set(MAGNUM_PLUGINS_FONTCONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/fontconverters)
set(MAGNUM_PLUGINS_FONTCONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/fontconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/imageconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/imageconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/imageconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/imageconverters)
set(MAGNUM_PLUGINS_IMPORTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/importers)
set(MAGNUM_PLUGINS_IMPORTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/importers)
set(MAGNUM_PLUGINS_IMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/importers)
set(MAGNUM_PLUGINS_IMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/importers)
set(MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/sceneconverters)
set(MAGNUM_PLUGINS_SCENECONVERTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/sceneconverters)
set(MAGNUM_PLUGINS_SCENECONVERTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/sceneconverters)
set(MAGNUM_PLUGINS_SCENECONVERTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/sceneconverters)
set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_BINARY_INSTALL_DIR}/audioimporters)
set(MAGNUM_PLUGINS_AUDIOIMPORTER_DEBUG_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_DEBUG_LIBRARY_INSTALL_DIR}/audioimporters)
set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_BINARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_BINARY_INSTALL_DIR}/audioimporters)
set(MAGNUM_PLUGINS_AUDIOIMPORTER_RELEASE_LIBRARY_INSTALL_DIR ${MAGNUM_PLUGINS_RELEASE_LIBRARY_INSTALL_DIR}/audioimporters)

set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/Magnum)
set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumExternal)
set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/MagnumPlugins)

add_subdirectory("source_subfolder")
24 changes: 24 additions & 0 deletions recipes/magnum-plugins/all/cmake/conan-bugfix-global-target.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# If using 'cmake_find_package', all the components are being added to the global
# target unconditionally. See generated FindMagnumPlugins.cmake file:
#
# if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
# if(NOT TARGET MagnumPlugins::MagnumPlugins)
# add_library(MagnumPlugins::MagnumPlugins INTERFACE IMPORTED)
# endif()
# set_property(TARGET MagnumPlugins::MagnumPlugins APPEND PROPERTY
# INTERFACE_LINK_LIBRARIES "${MagnumPlugins_COMPONENTS}")
# endif()
#
# but it doesn't add the library directories and the linker will fail.
#
# Here we fix this bug (breaking change) for this recipe, we just override
# the list of targets again.
#


if(NOT ${CMAKE_VERSION} VERSION_LESS "3.0")
if(TARGET MagnumPlugins::MagnumPlugins)
set_target_properties(MagnumPlugins::MagnumPlugins PROPERTIES INTERFACE_LINK_LIBRARIES
"${MagnumPlugins_MagnumPlugins_LINK_LIBS};${MagnumPlugins_MagnumPlugins_LINKER_FLAGS_LIST}")
endif()
endif()
11 changes: 11 additions & 0 deletions recipes/magnum-plugins/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sources:
"2020.06":
url: "https://github.com/mosra/magnum-plugins/archive/refs/tags/v2020.06.tar.gz"
sha256: "8650cab43570c826d2557d5b42459150d253316f7f734af8b3e7d0883510b40a"
patches:
"2020.06":
- base_path: "source_subfolder"
patch_file: "patches/2020.06/0001-emscripten-toolchain.patch"
# patch_type: "portability"
# description: "Remove unnecessary dependency on UseEmscripten"
# source: "https://github.com/mosra/magnum/issues/490"
Loading

0 comments on commit a73311d

Please sign in to comment.