Closed fran6co closed 4 weeks ago
Hi!
Installing the extra FindGLFW, FindOpenAL, ... modules system-wide is problematic, because those could cause conflicts with Find modules of other libraries (to my knowledge there's at least five different mutually incompatible FindSDL2.cmake
modules in the wild, for example). Figuring out a better way to handle these is on my TODO list for the next release (#411), but currently the designated way to do this is copying those by hand to the modules/
directory of your app (assuming you started with the bootstrap project).
Hope this helps :)
Thanks for the quick response. I thought I was just missing something obvious, thanks!
Finally, as of mosra/corrade@1eec665247a65961b01887d1165b153dbe7d28f9, 282f95d7239dbd4096896094d951cccc7a4782e8, mosra/magnum-plugins@69fe099567a084bc30b3952726263b167335c5c4 and mosra/magnum-integration@73af6075645aeee302ba5ffa3d0661cf677c0a8a the dependency Find modules get installed alongside Magnum and they're automatically used when finding dependencies. In other words, it's no longer needed for projects to bundle FindGLFW.cmake
, FindOpenGLES3.cmake
etc.
It's also done in a way that shouldn't cause them to clash with modules of the same supplied by other projects -- they get installed into a dependencies/
subdirectory and the directory is added to CMAKE_MODULE_PATH
only for the period where they may get used by find_package()
in Magnum's own modules, and is removed after.
Trying to follow the documentation for when Magnum was externally built and installed and I can't get it to work. Magnum compiles just fine but then it doesn't copy all the FindXXX.cmake files to the install folder. That causes the FindMagnum.cmake to fail when it tries to
find_package(GLFW)
. I think the fix would be to add them to the install as well, but I might be doing something wrong.It warns that it can't find GLFW in this line => https://github.com/mosra/magnum/blob/master/modules/FindMagnum.cmake#L632
and then it fails later when it tries to find
GLFW::GLFW
I believe the fix would be to just add the rest of the find cmakes to https://github.com/mosra/magnum/blob/master/modules/CMakeLists.txt but given that file hasn't been changed for a long time it makes me think that I'm doing something wrong instead