|
|
|
|
install(FILES AbstractContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
|
|
|
|
|
|
|
|
|
|
# GLUT context
|
|
|
|
|
if(WITH_GLUTCONTEXT)
|
|
|
|
|
find_package(GLUT)
|
|
|
|
|
if(GLUT_FOUND)
|
|
|
|
|
add_library(MagnumGlutContext STATIC GlutContext.cpp)
|
|
|
|
|
install(FILES GlutContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
|
|
|
|
|
install(TARGETS MagnumGlutContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
|
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "GLUT library, required by GlutContext, was not found. Set WITH_GLUTCONTEXT to OFF to skip building it.")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# SDL2 context
|
|
|
|
|
if(WITH_SDL2CONTEXT)
|
|
|
|
|
find_package(SDL2)
|
|
|
|
|
if(SDL2_FOUND)
|
|
|
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
|
|
|
|
add_library(MagnumSdl2Context STATIC Sdl2Context.cpp)
|
|
|
|
|
install(FILES Sdl2Context.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
|
|
|
|
|
install(TARGETS MagnumSdl2Context DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
|
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "SDL2 library, required by Sdl2Context, was not found. Set WITH_SDL2CONTEXT to OFF to skip building it.")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# X/EGL context
|
|
|
|
|
if(WITH_EGLCONTEXT)
|
|
|
|
|
find_package(EGL)
|
|
|
|
|
find_package(X11)
|
|
|
|
|
if(EGL_FOUND AND X11_FOUND)
|
|
|
|
|
add_library(MagnumEglContext STATIC EglContext.cpp)
|
|
|
|
|
# X11 macros are a mess, disable warnings for C-style casts
|
|
|
|
|
set_target_properties(MagnumEglContext PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
|
|
|
|
|
install(FILES EglContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
|
|
|
|
|
install(TARGETS MagnumEglContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
|
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "EGL or X11 libraries, required by EglContext, were not found. Set WITH_EGLCONTEXT to OFF to skip building it.")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|