forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
75 lines (59 loc) · 1.89 KB
/
Copy pathCMakeLists.txt
File metadata and controls
75 lines (59 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
cmake_minimum_required(VERSION 3.16...3.25)
legacy_check()
add_library(libobs-opengl SHARED)
add_library(OBS::libobs-opengl ALIAS libobs-opengl)
if(NOT TARGET OBS::glad)
add_subdirectory("${CMAKE_SOURCE_DIR}/deps/glad" "${CMAKE_BINARY_DIR}/deps/glad")
endif()
target_sources(
libobs-opengl
PRIVATE gl-helpers.c
gl-helpers.h
gl-indexbuffer.c
gl-shader.c
gl-shaderparser.c
gl-shaderparser.h
gl-stagesurf.c
gl-subsystem.c
gl-subsystem.h
gl-texture2d.c
gl-texture3d.c
gl-texturecube.c
gl-vertexbuffer.c
gl-zstencil.c)
target_link_libraries(libobs-opengl PRIVATE OBS::libobs OBS::glad)
if(OS_WINDOWS)
configure_file(cmake/windows/obs-module.rc.in libobs-opengl.rc)
target_sources(libobs-opengl PRIVATE gl-windows.c libobs-opengl.rc)
elseif(OS_MACOS)
find_library(COCOA Cocoa)
find_library(IOSURF IOSurface)
target_sources(libobs-opengl PRIVATE gl-cocoa.m)
target_compile_definitions(libobs-opengl PRIVATE GL_SILENCE_DEPRECATION)
target_link_libraries(libobs-opengl PRIVATE ${COCOA} ${IOSURF})
elseif(OS_LINUX OR OS_FREEBSD)
find_package(X11 REQUIRED)
find_package(
xcb
COMPONENTS xcb
REQUIRED)
find_package(x11-xcb REQUIRED)
target_sources(libobs-opengl PRIVATE gl-egl-common.c gl-nix.c gl-x11-egl.c)
target_link_libraries(libobs-opengl PRIVATE xcb::xcb X11::x11-xcb)
if(ENABLE_WAYLAND)
find_package(
OpenGL
COMPONENTS EGL
REQUIRED)
find_package(Wayland REQUIRED)
target_sources(libobs-opengl PRIVATE gl-wayland-egl.c)
target_link_libraries(libobs-opengl PRIVATE OpenGL::EGL Wayland::EGL)
endif()
endif()
target_enable_feature(libobs "OpenGL renderer")
set_target_properties_obs(
libobs-opengl
PROPERTIES FOLDER core
VERSION 0
PREFIX ""
SOVERSION "${OBS_VERSION_MAJOR}")