Browse Source

Split the OpenGL layer out, pt 27: CMake Magnum::{Context => GLContext}.

No backwards compatibility provided, sorry.
pull/233/head
Vladimír Vondruš 8 years ago
parent
commit
fca9a42148
  1. 2
      doc/changelog.dox
  2. 2
      doc/cmake.dox
  3. 53
      modules/FindMagnum.cmake

2
doc/changelog.dox

@ -290,6 +290,8 @@ See also:
to the complexity of this change, no backwards compatibility is provided. to the complexity of this change, no backwards compatibility is provided.
- The `magnum-info` utility was renamed to @ref magnum-gl-info. No backwards - The `magnum-info` utility was renamed to @ref magnum-gl-info. No backwards
compatibility symlinks or aliases are provided. 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 PixelStorage::dataProperties(), @ref Image::dataProperties(),
@ref ImageView::dataProperties(), @ref Trade::ImageData::dataProperties(), and @ref GL::BufferImage::dataProperties() now return just a pair of two @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 values, as the third value is now accessible directly through

2
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 is requested and found, its target is available in convenience alias
`Magnum::Application` / `Magnum::WindowlessApplication` to simplify porting. `Magnum::Application` / `Magnum::WindowlessApplication` to simplify porting.
Similarly, if exactly one `*Context` component is requested and found, its 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 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) library (or plugin) is found. If both debug and release libraries (or plugins)

53
modules/FindMagnum.cmake

@ -100,7 +100,7 @@
# component is requested and found, its target is available in convenience # component is requested and found, its target is available in convenience
# alias ``Magnum::Application`` / ``Magnum::WindowlessApplication`` to simplify # alias ``Magnum::Application`` / ``Magnum::WindowlessApplication`` to simplify
# porting. Similarly, if exactly one ``*Context`` component is requested and # 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 # 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 # 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) unset(_MAGNUM_APPLICATION_ALIAS)
endif() endif()
elseif(_component MATCHES ".+Context") elseif(_component MATCHES ".+Context")
if(NOT DEFINED _MAGNUM_CONTEXT_ALIAS) if(NOT DEFINED _MAGNUM_GLCONTEXT_ALIAS)
set(_MAGNUM_CONTEXT_ALIAS Magnum::${_component}) set(_MAGNUM_GLCONTEXT_ALIAS Magnum::${_component})
else() else()
unset(_MAGNUM_CONTEXT_ALIAS) unset(_MAGNUM_GLCONTEXT_ALIAS)
endif() endif()
endif() endif()
@ -870,35 +870,32 @@ if(_MAGNUM_APPLICATION_ALIAS AND NOT TARGET Magnum::Application)
# Prevent creating the alias again # Prevent creating the alias again
unset(_MAGNUM_APPLICATION_ALIAS) unset(_MAGNUM_APPLICATION_ALIAS)
endif() endif()
if(_MAGNUM_CONTEXT_ALIAS AND NOT TARGET Magnum::Context) if(_MAGNUM_GLCONTEXT_ALIAS AND NOT TARGET Magnum::GLContext)
get_target_property(_MAGNUM_CONTEXT_ALIASED_TARGET ${_MAGNUM_CONTEXT_ALIAS} ALIASED_TARGET) get_target_property(_MAGNUM_GLCONTEXT_ALIASED_TARGET ${_MAGNUM_GLCONTEXT_ALIAS} ALIASED_TARGET)
if(_MAGNUM_CONTEXT_ALIASED_TARGET) if(_MAGNUM_GLCONTEXT_ALIASED_TARGET)
add_library(Magnum::Context ALIAS ${_MAGNUM_CONTEXT_ALIASED_TARGET}) add_library(Magnum::GLContext ALIAS ${_MAGNUM_GLCONTEXT_ALIASED_TARGET})
else() else()
add_library(Magnum::Context UNKNOWN IMPORTED) add_library(Magnum::GLContext UNKNOWN IMPORTED)
get_target_property(_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_CONFIGURATIONS) get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_CONFIGURATIONS)
get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE) get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE)
get_target_property(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG) get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG)
set_target_properties(Magnum::Context PROPERTIES set_target_properties(Magnum::GLContext PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_CONTEXT_ALIAS},INTERFACE_INCLUDE_DIRECTORIES> INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_CONTEXT_ALIAS},INTERFACE_COMPILE_DEFINITIONS> INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_CONTEXT_ALIAS},INTERFACE_COMPILE_OPTIONS> INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_OPTIONS>
INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_CONTEXT_ALIAS},INTERFACE_LINK_LIBRARIES> INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_LINK_LIBRARIES>
IMPORTED_CONFIGURATIONS "${_MAGNUM_CONTEXT_IMPORTED_CONFIGURATIONS}") IMPORTED_CONFIGURATIONS "${_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS}")
if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE) if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE)
set_target_properties(Magnum::Context PROPERTIES set_target_properties(Magnum::GLContext PROPERTIES
IMPORTED_LOCATION_RELEASE ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_RELEASE}) IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE})
endif() endif()
if(_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG) if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG)
set_target_properties(Magnum::Context PROPERTIES set_target_properties(Magnum::GLContext PROPERTIES
IMPORTED_LOCATION_DEBUG ${_MAGNUM_CONTEXT_IMPORTED_LOCATION_DEBUG}) IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG})
endif() endif()
endif() endif()
if(MAGNUM_BUILD_DEPRECATED)
set(MAGNUM_CONTEXT_LIBRARIES Magnum::Context)
endif()
# Prevent creating the alias again # Prevent creating the alias again
unset(_MAGNUM_CONTEXT_ALIAS) unset(_MAGNUM_GLCONTEXT_ALIAS)
endif() endif()
# Installation and deploy dirs # Installation and deploy dirs

Loading…
Cancel
Save