MAGNUM_PLUGINS_DIR - Base directory with dynamic plugins, defaults to MAGNUM_PLUGINS_RELEASE_DIR in release builds and multi-configuration builds or to MAGNUM_PLUGINS_DEBUG_DIR in debug builds.Empty by default, which means the directory is autodetected based on library and executable location override if needed. MAGNUM_PLUGINS_RELEASE_DIR - Base directory with dynamic plugins for release builds.MAGNUM_PLUGINS_DEBUG_DIR - Base directory with dynamic plugins for debug builds.If a relative path is used, it's relative to CMAKE_INSTALL_PREFIX. MAGNUM_INCLUDE_INSTALL_PREFIX - Prefix where to put platform-independent include and other files, defaults to.MAGNUM_DEPLOY_PREFIX - Prefix where to put final application executables, defaults to.Magnum::Magnum - Base library imported target.Magnum_FOUND - Whether the library was found.This module tries to find the base Magnum library and then defines the following: Finding the package and its componentsīasic usage is: find_package ( Magnum REQUIRED ) set ( MAGNUM_WITH_ANYIMAGEIMPORTER ON CACHE BOOL "" FORCE ) set ( MAGNUM_WITH_ANYSCENEIMPORTER ON CACHE BOOL "" FORCE ) add_subdirectory ( magnum EXCLUDE_FROM_ALL ) # So the AnyImageImporter / AnySceneImporter gets built implicitly add_dependencies ( your-app Magnum::AnyImageImporter Magnum::AnySceneImporter )Įach namespace, plugin and application class provides further information about additional steps needed for a CMake subproject setup. Please note that in case of the (by default) dynamic plugins, because these are loaded at runtime, CMake doesn't know we need them to be built - one option is to list them explicitly like shown below, another (but uglier) is to not use EXCLUDE_FROM_ALL on the magnum subdirectory, so everything is always built implicitly. If you want to disable this behavior altogether and keep all executables and libraries in their implicit locations, set those variables to an empty string (as opposed to nothing at all, which is the same as if the variable is not set) - Magnum will detect and respect that: # I'm happy with having binaries scattered around the build dir set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY "" ) set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY "" ) set ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "" ) add_subdirectory ( corrade EXCLUDE_FROM_ALL ) add_subdirectory ( magnum EXCLUDE_FROM_ALL ) The main logic is in the FindMagnum.cmake module distributed with the engine in the modules/ directory, you are encouraged to copy it along with FindCorrade.cmake into your project and add path to the files to CMAKE_MODULE_PATH: # Path where FindCorrade.cmake & FindMagnum.cmake can be found, adapt as needed set ( CMAKE_MODULE_PATH "$_OUTPUT_DIRECTORY, those will get used instead (and you can also set your own output directories after the add_subdirectory () call, which will make Magnum keep the above). ![]() Using Magnum that was externally built and installed If you wish to use a different buildsystem, see Using Magnum with custom buildsystems instead. The following guide explains how to use it. ![]() Magnum uses CMake as a primary build system for both building and integration into your projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |