2014-01-20 07:58:58 -08:00
|
|
|
project(libobs-opengl)
|
|
|
|
|
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
2014-04-01 12:30:52 -07:00
|
|
|
include_directories(${OPENGL_INCLUDE_DIR})
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
add_definitions(-DLIBOBS_EXPORTS)
|
|
|
|
|
|
|
|
if(WIN32)
|
2014-04-05 11:21:19 -07:00
|
|
|
set(libobs-opengl_PLATFORM_SOURCES
|
|
|
|
gl-windows.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)
|
2014-12-06 11:53:04 -08:00
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
find_library(COCOA Cocoa)
|
|
|
|
include_directories(${COCOA})
|
2014-04-01 12:30:52 -07:00
|
|
|
mark_as_advanced(COCOA)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
find_library(IOSURF IOSurface)
|
|
|
|
include_directories(${IOSURF})
|
|
|
|
mark_as_advanced(${IOSURF})
|
|
|
|
|
|
|
|
set(libobs-opengl_PLATFORM_DEPS
|
|
|
|
${COCOA}
|
2014-05-08 05:31:43 -07:00
|
|
|
${IOSURF}
|
|
|
|
${OPENGL_gl_LIBRARY})
|
2014-12-06 11:53:04 -08:00
|
|
|
else() #This needs to change to be more specific to get ready for Wayland
|
|
|
|
find_package(XCB COMPONENTS XCB REQUIRED)
|
|
|
|
find_package(X11_XCB REQUIRED)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${XCB_INCLUDE_DIRS}
|
|
|
|
${X11_XCB_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
add_definitions(
|
|
|
|
${XCB_DEFINITIONS}
|
|
|
|
${X11_XCB_DEFINITIONS})
|
|
|
|
|
|
|
|
set(libobs-opengl_PLATFORM_DEPS
|
|
|
|
${XCB_LIBRARIES}
|
|
|
|
${X11_XCB_LIBRARIES})
|
|
|
|
|
2014-01-24 19:55:10 -08:00
|
|
|
set(libobs-opengl_PLATFORM_SOURCES
|
2014-04-05 11:21:19 -07:00
|
|
|
gl-x11.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
|
2014-04-05 11:21:19 -07:00
|
|
|
gl-zstencil.c)
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
set(libobs-opengl_HEADERS
|
|
|
|
gl-helpers.h
|
|
|
|
gl-shaderparser.h
|
|
|
|
gl-subsystem.h)
|
|
|
|
|
2015-02-13 17:13:52 -08:00
|
|
|
if(WIN32 OR APPLE)
|
|
|
|
add_library(libobs-opengl MODULE
|
|
|
|
${libobs-opengl_SOURCES}
|
|
|
|
${libobs-opengl_HEADERS})
|
|
|
|
else()
|
|
|
|
add_library(libobs-opengl SHARED
|
|
|
|
${libobs-opengl_SOURCES}
|
|
|
|
${libobs-opengl_HEADERS})
|
|
|
|
endif()
|
2015-01-13 21:35:58 -08:00
|
|
|
|
|
|
|
if(WIN32 OR APPLE)
|
|
|
|
set_target_properties(libobs-opengl
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME libobs-opengl
|
|
|
|
PREFIX "")
|
|
|
|
else()
|
2014-01-20 07:58:58 -08:00
|
|
|
set_target_properties(libobs-opengl
|
|
|
|
PROPERTIES
|
2015-01-09 11:19:22 -08:00
|
|
|
OUTPUT_NAME obs-opengl
|
|
|
|
VERSION 0.0
|
|
|
|
SOVERSION 0
|
|
|
|
)
|
2015-01-13 21:35:58 -08:00
|
|
|
endif()
|
|
|
|
|
2014-01-20 07:58:58 -08:00
|
|
|
target_link_libraries(libobs-opengl
|
|
|
|
libobs
|
2014-04-14 14:28:07 -07:00
|
|
|
glad
|
2014-04-05 11:21:19 -07:00
|
|
|
${libobs-opengl_PLATFORM_DEPS})
|
2014-01-20 07:58:58 -08:00
|
|
|
|
|
|
|
install_obs_core(libobs-opengl)
|