You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> is set, trying to load plugins will fail. Example error message:
PluginManager::Manager::Manager(): none of the plugin search paths in {C:/code/magnum/bld/vs/Debug/bin/magnum-d/importers, magnum-d/importers} exists and pluginDirectory was not set, skipping plugin discovery
PluginManager::Manager::load(): plugin TgaImporter is not static and was not found in
As described here, if this variable is set, it is used to initialize the RUNTIME_OUTPUT_DIRECTORY_<CONFIG> property of each target. This property takes precedence over the RUNITME_OUPUT_DIRECTORY property. This means that the output directories that are set in each plugin's CMakeLists end up being overridden. This causes the plugin library to not be built into the expected location, causing it to fail to load at runtime.
To reproduce
Build Magnum as a subproject as in Example 1a of the Getting Started guide. Add the following lines to CMake before add_subdirectory(magnum):
Just as a note, in my case I ran into this because of Conan. By default, conan_basic_setup modifies the build output directories by setting these CMake variables. I switched to using conan_basic_setup(NO_OUTPUT_DIRS) to avoid this behavior.
yeah, the plugins are expected to be in those particular subdirectories (magnum/blah) relative to the interface library, otherwise it's not really possible for the plugin manager to discover them or know which plugin is which. The library already decides based on presence / value of CMAKE_RUNTIME_OUTPUT_DIRECTORY on its own, but isn't currently aware of CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG>.
Environment
Problem
If
CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
is set, trying to load plugins will fail. Example error message:As described here, if this variable is set, it is used to initialize the
RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
property of each target. This property takes precedence over theRUNITME_OUPUT_DIRECTORY
property. This means that the output directories that are set in each plugin's CMakeLists end up being overridden. This causes the plugin library to not be built into the expected location, causing it to fail to load at runtime.To reproduce
Build Magnum as a subproject as in Example 1a of the Getting Started guide. Add the following lines to CMake before
add_subdirectory(magnum)
:Then build with some plugin enabled and try to load the plugin at runtime.
The text was updated successfully, but these errors were encountered: