diff --git a/doc/changelog.dox b/doc/changelog.dox index 4b9b1d43b..188876e43 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -290,6 +290,8 @@ See also: to the complexity of this change, no backwards compatibility is provided. - The `magnum-info` utility was renamed to @ref magnum-gl-info. No backwards compatibility symlinks or aliases are provided. +- The `Magnum::Context` target alias was renamed to `Magnum::GLContext`. No + backwards compatibility aliases are provided. - @ref PixelStorage::dataProperties(), @ref Image::dataProperties(), @ref ImageView::dataProperties(), @ref Trade::ImageData::dataProperties(), and @ref GL::BufferImage::dataProperties() now return just a pair of two values, as the third value is now accessible directly through diff --git a/doc/cmake.dox b/doc/cmake.dox index 6f82cc474..c17506517 100644 --- a/doc/cmake.dox +++ b/doc/cmake.dox @@ -187,7 +187,7 @@ If exactly one `*Application` or exactly one `Windowless*Application` component is requested and found, its target is available in convenience alias `Magnum::Application` / `Magnum::WindowlessApplication` to simplify porting. Similarly, if exactly one `*Context` component is requested and found, its -target is available in convenience alias `Magnum::Context`. +target is available in convenience alias `Magnum::GLContext`. The package is found if either debug or release version of each requested library (or plugin) is found. If both debug and release libraries (or plugins) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index a39107f45..90cc5ebb4 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -100,7 +100,7 @@ # component is requested and found, its target is available in convenience # alias ``Magnum::Application`` / ``Magnum::WindowlessApplication`` to simplify # porting. Similarly, if exactly one ``*Context`` component is requested and -# found, its target is available in convenience alias ``Magnum::Context``. +# found, its target is available in convenience alias ``Magnum::GLContext``. # # The package is found if either debug or release version of each requested # library (or plugin) is found. If both debug and release libraries (or @@ -789,10 +789,10 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) unset(_MAGNUM_APPLICATION_ALIAS) endif() elseif(_component MATCHES ".+Context") - if(NOT DEFINED _MAGNUM_CONTEXT_ALIAS) - set(_MAGNUM_CONTEXT_ALIAS Magnum::${_component}) + if(NOT DEFINED _MAGNUM_GLCONTEXT_ALIAS) + set(_MAGNUM_GLCONTEXT_ALIAS Magnum::${_component}) else() - unset(_MAGNUM_CONTEXT_ALIAS) + unset(_MAGNUM_GLCONTEXT_ALIAS) endif() endif() @@ -870,35 +870,32 @@ if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application) # Prevent creating the alias again unset(_MAGNUM_APPLICATION_ALIAS) endif() -if(_MAGNUM_CONTEXT_ALIAS AND NOT TARGET Magnum::Context) - get_target_property(_MAGNUM_CONTEXT_ALIASED_TARGET ${_MAGNUM_CONTEXT_ALIAS} ALIASED_TARGET) - if(_MAGNUM_CONTEXT_ALIASED_TARGET) - add_library(Magnum::Context ALIAS ${_MAGNUM_CONTEXT_ALIASED_TARGET}) +if(_MAGNUM_GLCONTEXT_ALIAS AND NOT TARGET Magnum::GLContext) + get_target_property(_MAGNUM_GLCONTEXT_ALIASED_TARGET ${_MAGNUM_GLCONTEXT_ALIAS} ALIASED_TARGET) + if(_MAGNUM_GLCONTEXT_ALIASED_TARGET) + add_library(Magnum::GLContext ALIAS ${_MAGNUM_GLCONTEXT_ALIASED_TARGET}) else() - add_library(Magnum::Context UNKNOWN IMPORTED) - get_target_property(_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_CONFIGURATIONS) - get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE) - get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG) - set_target_properties(Magnum::Context PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES $ - INTERFACE_COMPILE_DEFINITIONS $ - INTERFACE_COMPILE_OPTIONS $ - INTERFACE_LINK_LIBRARIES $ - IMPORTED_CONFIGURATIONS "${_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS}") - if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE) - set_target_properties(Magnum::Context PROPERTIES - IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE}) + add_library(Magnum::GLContext UNKNOWN IMPORTED) + get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_CONFIGURATIONS) + get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE) + get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::GLContext PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS $ + INTERFACE_COMPILE_OPTIONS $ + INTERFACE_LINK_LIBRARIES $ + IMPORTED_CONFIGURATIONS "${_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS}") + if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE) + set_target_properties(Magnum::GLContext PROPERTIES + IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE}) endif() - if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG) - set_target_properties(Magnum::Context PROPERTIES - IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG}) + if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG) + set_target_properties(Magnum::GLContext PROPERTIES + IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG}) endif() endif() - if(MAGNUM_BUILD_DEPRECATED) - set(MAGNUM_CONTEXT_LIBRARIES Magnum::Context) - endif() # Prevent creating the alias again - unset(_MAGNUM_CONTEXT_ALIAS) + unset(_MAGNUM_GLCONTEXT_ALIAS) endif() # Installation and deploy dirs