summaryrefslogtreecommitdiff
path: root/src/waffle/CMakeLists.txt
blob: ed82321f19192a44c8e0829acae706da0f7469f3 (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# ----------------------------------------------------------------------------
# Target: waffle (shared library)
# ----------------------------------------------------------------------------

set(waffle_sources
    api/api_priv.c
    api/waffle_attrib_list.c
    api/waffle_config.c
    api/waffle_context.c
    api/waffle_display.c
    api/waffle_enum.c
    api/waffle_error.c
    api/waffle_gl_misc.c
    api/waffle_init.c
    api/waffle_window.c
    core/wcore_config_attrs.c
    core/wcore_error.c
    core/wcore_platform.c
    )

if(waffle_has_egl)
    list(APPEND waffle_sources
        egl/egl_no_native.c
        )
endif(waffle_has_egl)

if(waffle_has_glx)
    list(APPEND waffle_sources
        glx/glx_config.c
        glx/glx_context.c
        glx/glx_display.c
        glx/glx_gl_misc.c
        glx/glx_platform.c
        glx/glx_window.c
        )
endif(waffle_has_glx)

if(waffle_has_wayland)
    list(APPEND waffle_sources
        wayland/wayland_config.c
        wayland/wayland_context.c
        wayland/wayland_display.c
        wayland/wayland_gl_misc.c
        wayland/wayland_platform.c
        wayland/wayland_priv_egl.c
        wayland/wayland_window.c
    )
endif(waffle_has_wayland)

if(waffle_has_x11)
    list(APPEND waffle_sources
        x11/x11.c
        )
endif(waffle_has_x11)

if(waffle_has_x11_egl)
    list(APPEND waffle_sources
        x11_egl/xegl_config.c
        x11_egl/xegl_context.c
        x11_egl/xegl_display.c
        x11_egl/xegl_gl_misc.c
        x11_egl/xegl_platform.c
        x11_egl/xegl_priv_egl.c
        x11_egl/xegl_window.c
    )
endif(waffle_has_x11_egl)

add_library(waffle SHARED ${waffle_sources})

if(waffle_has_egl)
  target_link_libraries(waffle ${waffle_EGL_library})
endif(waffle_has_egl)

if(waffle_has_glx)
    target_link_libraries(waffle ${waffle_GL_library})
endif(waffle_has_glx)

if(waffle_has_wayland)
    target_link_libraries(waffle
        ${waffle_wayland-client_library}
        ${waffle_wayland-egl_library}
        )
endif(waffle_has_wayland)

if(waffle_has_x11_egl)
  target_link_libraries(waffle ${waffle_X11-xcb_library})
endif(waffle_has_x11_egl)

set_target_properties(waffle
    PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
    SOVERSION ${waffle_so_version})

install(TARGETS waffle
    LIBRARY DESTINATION ${waffle_install_libdir})