diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-04-11 08:54:14 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-04-11 16:51:04 -0700 |
commit | 57790f8105a70d7604ddcf6d6bd62d5776938ab3 (patch) | |
tree | 43c0867d3570e89f86e1471bc7f51528755bfd04 | |
parent | 65856228ffa4c7a43bf67ce13ef99cb18ee58c83 (diff) |
cmake: Add wayland support
Add cach option `waffle_has_wayland`. If set, then
- Define macro WAFFLE_HAS_WAYLAND.
- Require libwayland-client and libwayland-egl.
- Link them into libwaffle.
No wayland sources are compiled yet.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | CMakeLists.txt | 23 | ||||
-rw-r--r-- | src/waffle/CMakeLists.txt | 7 |
2 files changed, 27 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f3cb27..cb22574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,7 @@ option(waffle_build_tests "Build tests" ON) option(waffle_build_examples "Build examples" ON) option(waffle_has_glx "Build support for GLX" OFF) +option(waffle_has_wayland "Build support for Wayland" OFF) option(waffle_has_x11_egl "Build support for X11/EGL" OFF) set(waffle_install_includedir "${CMAKE_INSTALL_PREFIX}/include" @@ -55,11 +56,11 @@ set(waffle_install_docdir "${CMAKE_INSTALL_PREFIX}/share/doc/waffle" # Set internal options. # -if(waffle_has_x11_egl) +if(waffle_has_wayland OR waffle_has_x11_egl) set(waffle_has_egl TRUE) -else(waffle_has_x11_egl) +else(waffle_has_wayland OR waffle_has_x11_egl) set(waffle_has_egl FALSE) -endif(waffle_has_x11_egl) +endif(waffle_has_wayland OR waffle_has_x11_egl) if(waffle_has_glx OR waffle_has_x11_egl) set(waffle_has_x11 TRUE) @@ -100,6 +101,11 @@ if(waffle_has_glx) waffle_find_library(waffle_GL_library GL) endif(waffle_has_glx) +if(waffle_has_wayland) + waffle_find_library(waffle_wayland-client_library wayland-client) + waffle_find_library(waffle_wayland-egl_library wayland-egl) +endif(waffle_has_wayland) + if(waffle_has_x11) waffle_find_library(waffle_X11-xcb_library X11-xcb) endif(waffle_has_x11) @@ -128,6 +134,10 @@ if(waffle_has_glx) add_definitions(-DWAFFLE_HAS_GLX) endif(waffle_has_glx) +if(waffle_has_wayland) + add_definitions(-DWAFFLE_HAS_WAYLAND) +endif(waffle_has_wayland) + if(waffle_has_x11_egl) add_definitions(-DWAFFLE_HAS_X11_EGL) endif(waffle_has_x11_egl) @@ -187,6 +197,9 @@ message("Supported platforms: ") if(waffle_has_glx) message(" glx") endif(waffle_has_glx) +if(waffle_has_wayland) + message(" wayland") +endif(waffle_has_wayland) if(waffle_has_x11_egl) message(" x11_egl") endif(waffle_has_x11_egl) @@ -198,6 +211,10 @@ endif(DEFINED waffle_EGL_library) if(DEFINED waffle_GL_library) message(" GL: ${waffle_GL_library}") endif(DEFINED waffle_GL_library) +if(waffle_has_wayland) + message(" wayland-client: ${waffle_wayland-client_library}") + message(" wayland-egl: ${waffle_wayland-egl_library}") +endif(waffle_has_wayland) if(DEFINED waffle_X11-xcb_library) message(" X11-xcb: ${waffle_X11-xcb_library}") endif(DEFINED waffle_X11-xcb_library) diff --git a/src/waffle/CMakeLists.txt b/src/waffle/CMakeLists.txt index bbf899b..da4938b 100644 --- a/src/waffle/CMakeLists.txt +++ b/src/waffle/CMakeLists.txt @@ -63,6 +63,13 @@ 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) |