No need for them to be classes, less indentation, less keywords and
boilerplate, more space for documentation, better `using` usage. Also
revised and fixed various issues in the documentation.
As with Corrade, this is not exactly backwards compatible, but for
common use case without OBJECT libraries this should not be a problem.
In any case, recreate the build dir and update your copy of all
Find*.cmake modules to avoid weird things happening.
User-facing changes:
* Documentation of all Find*.cmake modules converted to
reStructuredText to follow official CMake guidelines.
* The newfangled way to use the libraries is to link to Magnum::Shaders
instead of adding ${MAGNUM_SHADERS_INCLUDE_DIRS} to include path and
linking to ${MAGNUM_SHADERS_LIBRARIES}.
* The old ${MAGNUM_*_LIBRARIES} are deprecated and now just expand to
Magnum::* target. Use the target directly. These are also enabled
only when building with MAGNUM_BUILD_DEPRECATED.
* The old ${MAGNUM_*_INCLUDE_DIRS} are removed as the Magnum::* targets
cover these too.
Internal changes:
* Global state such as include_directories() was replaced with
target-specific settings.
It is often annoying to write e.g. this, especially in generic code:
T dot = Math::Vector<size, T>::dot(a, b);
When this is more than enough and the compiler can infer the rest from
the context:
T dot = Math::dot(a, b);
There are more downsides and confusing cases (you can call
Math::Vector<3, T>::dot(), Math::Vector3<T>::dot() and Color3::dot() and
it is still the same function), so I made these as free functions in
Math namespace. You can now also abuse ADL for the calls, but I would
advise against that for better readability:
T d = dot(a, b); // dot?! what on earth is dot? and what is a?
The only downside found when porting is that you need to specify the
type somehow when having both parameters as initializer lists:
T d = dot({2.0f, -1.5f}, {1.0f, 2.5f}); // error
T d = dot(Complex{2.0f, -1.5f}, {1.0f, 2.5f}); // okay
But that's probably reasonable (and it's also highly corner case,
the functions were used this way only in tests).
The original static member functions are of course still present, but
marked as deprecated and will be removed at some point in future.
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.