Do the same also for other Unix-like systems except for Apple platforms,
where those dependencies are most probably satisfied by some frameworks
instead.
Yet again I merged too soon :/ b70ac5fa51
was not working for me at all -- on Arch the installed config file has
only one IMPORTED_CONFIGURATION, NOCONFIG, which wasn't propagated.
Besides that, there were some compiler definitions and other things that
*also* weren't propagated from the config file.
Reworked it totally in a simpler way, which doesn't work on CMake 2.8.12
anymore (but also who cares, systems that are stuck on 2.8.12 don't have
GLFW3 in repositories anyway).
Previously, when requesting OpenGLTester, the script correctly found
that it needs some Windowless*Application and a GL library and added
them as dependencies to OpenGLTester. But it didn't handle the
dependency of Windowless*Application on GL, which caused GL to be linked
*before* Windowless*Application, causing linker to complain that
Windowless*Application needs some more stuff from GL.
This will later enable conditional compilation of APIs that depend on
the GL library (for example the Text library directly producing compiled
meshes instead of just plain vertex data).
Statically built plugins get imported automatically when using CMake
3.1 and newer. Otherwise simply #include a corresponding
importStaticPlugin.cpp file.
It's not like with SDL where we can't use <SDL2/SDL.h> due to macOS
packaged shipped without the SDL2 include directory.
This was just a bad copypaste from the FindSDL2.cmake module, probably.
On Emscripten this was equal to ";somebogusprefix" (as per the
toolchain), which got expanded into just somebogusprefix, losing the
empty string. Saving it back to CMAKE_FIND_LIBRARY_PREFIXES would cause
all subsequent find_library() calls to fail, because no library is named
somebogusprefixMagnum*.bc.
Thinking about this, the "somebogusprefix" was probably added "back
then" as a workaround to CMake complaining that I'm messing up in the
Find module. So I guess I can remove that as well.
Size of all executables got inflated by *half a megabyte* because of
this. I'm not sure if the change is worth it, so reverting for now.
This reverts commits
c01961ba6b5fb3f435ddfada6fba05
This affect virtually *all* targets so I would need to put this
everywhere, which I'm not. I am putting this only for the most often
used (and thus most problematic) dependencies, which is SDL and GLFW.
There will be numerous additions to this one so it made sense to make it
a static library instead of a header-only library. That also allows
CMake users to just link to Magnum::OpenGLTester instead of going
through the pain of a huge branching in order to find a correct
windowless application just to run their tests. It could have been done
even without the static library using a INTERFACE target, but that
wouldn't work on CMake < 3.0 (which, unfortunately, quite a few people
are still stuck with).
Unfortunately it's already heavily used elsewhere so I had to go through
the pain of deprecating the old implementation. The old implementation
was header-only so it can't be just typedef'd to the new one as there
would be linker failures. So the old header is just kept as it was, with
only the macros reduced.