2014-01-20 07:58:58 -08:00
|
|
|
project(libobs-opengl)
|
|
|
|
|
|
|
|
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/libobs")
|
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
include_directories(${OPENGL_INCLUDE_DIRS})
|
|
|
|
include_directories(SYSTEM glew/include)
|
|
|
|
add_definitions(-DGLEW_STATIC)
|
|
|
|
|
|
|
|
add_definitions(-DLIBOBS_EXPORTS)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(libobs-opengl_PLATFORM_SOURCES
|
2014-01-24 23:32:20 -08:00
|
|
|
gl-windows.c
|
2014-01-25 17:32:27 -08:00
|
|
|
GL/wgl_obs.c)
|
2014-01-20 07:58:58 -08:00
|
|
|
elseif(APPLE)
|
|
|
|
set(libobs-opengl_PLATFORM_SOURCES
|
|
|
|
gl-cocoa.m)
|
|
|
|
|
|
|
|
set_source_files_properties(${libobs-opengl_PLATFORM_SOURCES}
|
|
|
|
PROPERTIES
|
|
|
|
LANGUAGE C)
|
|
|
|
|
|
|
|
find_library(COCOA Cocoa)
|
|
|
|
mark_as_advanced(COCOA)
|
|
|
|
include_directories(${COCOA})
|
|
|
|
|
|
|
|
find_library(IOSURF IOSurface)
|
|
|
|
include_directories(${IOSURF})
|
|
|
|
mark_as_advanced(${IOSURF})
|
|
|
|
|
|
|
|
set(libobs-opengl_PLATFORM_DEPS
|
|
|
|
${COCOA}
|
|
|
|
${IOSURF})
|
2014-01-24 19:55:10 -08:00
|
|
|
else()
|
|
|
|
set(libobs-opengl_PLATFORM_SOURCES
|
2014-01-24 23:32:20 -08:00
|
|
|
gl-x11.c
|
|
|
|
GL/glx_obs.c)
|
2014-01-20 07:58:58 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(libobs-opengl_SOURCES
|
|
|
|
${libobs-opengl_PLATFORM_SOURCES}
|
|
|
|
gl-helpers.c
|
|
|
|
gl-indexbuffer.c
|
|
|
|
gl-shader.c
|
|
|
|
gl-shaderparser.c
|
|
|
|
gl-stagesurf.c
|
|
|
|
gl-subsystem.c
|
|
|
|
gl-texture2d.c
|
|
|
|
gl-texturecube.c
|
|
|
|
gl-vertexbuffer.c
|
|
|
|
gl-zstencil.c
|
2014-01-24 23:32:20 -08:00
|
|
|
GL/gl_obs.c)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
set(libobs-opengl_HEADERS
|
|
|
|
gl-exports.h
|
|
|
|
gl-helpers.h
|
|
|
|
gl-shaderparser.h
|
|
|
|
gl-subsystem.h)
|
|
|
|
|
|
|
|
add_library(libobs-opengl MODULE
|
|
|
|
${libobs-opengl_SOURCES}
|
|
|
|
${libobs-opengl_HEADERS})
|
|
|
|
set_target_properties(libobs-opengl
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME libobs-opengl
|
|
|
|
PREFIX "")
|
|
|
|
target_link_libraries(libobs-opengl
|
|
|
|
libobs
|
|
|
|
${libobs-opengl_PLATFORM_DEPS}
|
|
|
|
${OPENGL_LIBRARIES})
|
|
|
|
|
|
|
|
install_obs_core(libobs-opengl)
|