Browse Source

Fix Mir and Wayland auto-detection to also check on EGL.

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
f9b23104dd

+ 7 - 7
CMake/Modules/FindMir.cmake

@@ -24,23 +24,23 @@
 #
 #  MIR_FOUND
 #  MIR_INCLUDE_DIRS
-#  MIR_LIBRARIES
 #  MIR_CLIENT
 #  MIR_COMMON
+#  EGL
 #  XKB
 #
 
-find_path (MIR_CLIENT_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h DOC "Mir client include directory")
-find_path (MIR_COMMON_INCLUDE_DIR NAMES mir_toolkit/common.h DOC "Mir common include directory")
+find_path (MIR_CLIENT_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h PATH_SUFFIXES mirclient DOC "Mir client include directory")
+find_path (MIR_COMMON_INCLUDE_DIR NAMES mir_toolkit/common.h PATH_SUFFIXES mircommon DOC "Mir common include directory")
 find_library (MIR_CLIENT NAMES mirclient DOC "Mir client library")
 find_library (MIR_COMMON NAMES mircommon DOC "Mir common library")
-find_library (XKB NAMES xkbcommon DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
+find_library (EGL NAMES EGL DOC "EGL library")
+find_library (XKB NAMES xkbcommon DOC "Xkb common library")
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Mir REQUIRED_VARS MIR_CLIENT MIR_COMMON XKB MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR FAIL_MESSAGE "Could NOT find Mir display server")
+find_package_handle_standard_args (Mir REQUIRED_VARS MIR_CLIENT MIR_COMMON EGL XKB MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR FAIL_MESSAGE "Could NOT find Mir display server")
 if (MIR_FOUND)
     set (MIR_INCLUDE_DIRS ${MIR_CLIENT_INCLUDE_DIR} ${MIR_COMMON_INCLUDE_DIR})
-    set (MIR_LIBRARIES ${MIR_CLIENT} ${MIR_COMMON} ${XKB})
 endif ()
 
-mark_as_advanced (MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR MIR_CLIENT MIR_COMMON XKB)
+mark_as_advanced (MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR MIR_CLIENT MIR_COMMON EGL XKB)

+ 6 - 8
CMake/Modules/FindWayland.cmake

@@ -24,23 +24,21 @@
 #
 #  WAYLAND_FOUND
 #  WAYLAND_INCLUDE_DIRS
-#  WAYLAND_LIBRARIES
 #  WAYLAND_CLIENT
 #  WAYLAND_CURSOR
 #  WAYLAND_EGL
+#  EGL
 #  XKB
 #
 
 find_path (WAYLAND_INCLUDE_DIRS NAMES wayland-client.h DOC "Wayland include directory")
 find_library (WAYLAND_CLIENT NAMES wayland-client DOC "Wayland client library")
 find_library (WAYLAND_CURSOR NAMES wayland-cursor DOC "Wayland compositor infrastructure - cursor library")
-find_library (WAYLAND_EGL NAMES wayland-egl DOC "Wayland EGL platform - runtime")
-find_library (XKB NAMES xkbcommon DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
+find_library (WAYLAND_EGL NAMES wayland-egl DOC "Wayland EGL library")
+find_library (EGL NAMES EGL DOC "EGL library")
+find_library (XKB NAMES xkbcommon DOC "Xkb common library")
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Wayland REQUIRED_VARS WAYLAND_CLIENT WAYLAND_CURSOR WAYLAND_EGL XKB WAYLAND_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Wayland display server")
-if (WAYLAND_FOUND)
-    set (WAYLAND_LIBRARIES ${WAYLAND_CLIENT} ${WAYLAND_CURSOR} ${WAYLAND_EGL} ${XKB})
-endif ()
+find_package_handle_standard_args (Wayland REQUIRED_VARS WAYLAND_CLIENT WAYLAND_CURSOR WAYLAND_EGL EGL XKB WAYLAND_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Wayland display server")
 
-mark_as_advanced (WAYLAND_INCLUDE_DIRS WAYLAND_LIBRARIES WAYLAND_CLIENT WAYLAND_CURSOR WAYLAND_EGL XKB)
+mark_as_advanced (WAYLAND_INCLUDE_DIRS WAYLAND_CLIENT WAYLAND_CURSOR WAYLAND_EGL EGL XKB)

+ 5 - 4
Docs/GettingStarted.dox

@@ -18,9 +18,9 @@ Although all required third-party libraries are included as source code, there a
     - unixodbc-dev (Debian-based) or unixODBC-devel (RedHat-based) for ODBC driver manager.
   + Display server (essential). One or more of these can be installed at the same time. When multiple display servers are available, X11 takes precedence (overridable using SDL_VIDEODRIVER environment variable during application runtime).
     - libdirectfb-dev (Debian-based only) for Direct Frame Buffer (DirectFB). Disabled by default even when installed, use SDL_OPT_VIDEO_DIRECTFB build option to enable.
-    - mir-client-platform-mesa-dev and mircommon-dev (Ubuntu only) for Mir.
-    - libwayland-client-devel, libwayland-cursor-devel, and mesa-libwayland-egl-devel (RedHat-based only, pre-installed on Fedora 22+) for Wayland.
-    - libx11-dev and libxrandr-dev (Debian-based) or libX11-devel and libXrandr-devel (RedHat-based) for X11.
+    - libegl1-mesa-dev and mir-client-platform-mesa-dev (Ubuntu only) for Mir.
+    - libegl1-mesa-dev and libwayland-dev (Debian-based) or libwayland-client-devel, libwayland-cursor-devel, and mesa-libwayland-egl-devel (RedHat-based) for Wayland.
+    - libx11-dev, libxcursor-dev, libxext-dev, libxi-dev, libxinerama-dev, libxrandr-dev, libxrender-dev, and libxss-dev (Debian-based) or libX11-devel, libXcursor-devel, libXext-devel, libXi-devel, libXinerama-devel, libXrandr-devel, libXrender-devel, and libXScrnSaver-devel (RedHat-based) for X11 and its extensions. Alternatively, you can use xorg-devel meta package on Debian-based system, but it would install other unneeded packages as well.
   + %Sound server (essential). One or more of these can be installed at the same time. When multiple sound servers are available, PulseAudio takes precedence (overridable using SDL_AUDIODRIVER environment variable during application runtime).
     - libasound2-dev (Debian-based) or  alsa-lib-devel (RedHat-based) for Advanced Linux %Sound Architecture (ALSA).
     - arts-devel (RedHat-based only) for Analog Real %Time Synthesizer (aRts).
@@ -30,9 +30,10 @@ Although all required third-party libraries are included as source code, there a
     - libpulse-dev (Debian-based) or pulseaudio-libs-devel (RedHat-based) for PulseAudio.
     - libroar-dev (Debian-based only) for RoarAudio (SNDIO).
   + Miscellaneous (optional).
-    - libudev-dev (Debian-based) or systemd-devel (Redhat-based) for input device hot-plugging.
+    - libdbus-1-dev (Debian-based) or dbus-devel (Redhat-based) for system-wide messaging (e.g. inhibiting screen-saver).
     - libreadline6-dev (Debian-based) or readline-devel (Redhat-based) for easy editing of command lines in interactive standalone host tools, e.g. isql and lua interpreter.
     - libts-dev (Debian-based) or tslib-devel (RedHat-based) for resistive, single-touch touchscreen input for embedded Linux device, e.g. Pandora and Wiz. Modern multi-touch touchscreen does not need this.
+    - libudev-dev (Debian-based) or systemd-devel (Redhat-based) for input device hot-plugging.
 
 - For Raspberry Pi, follow the building prerequisite for Linux above, with the exception for display server. Raspberry Pi operating system usually already comes with Broadcom Video Core display server preinstalled. On top of that, you must also install this package: libevdev2 (Raspbian)o or libevdev (Pidora).
 

+ 2 - 0
Source/ThirdParty/SDL/cmake/sdlchecks.cmake

@@ -561,6 +561,7 @@ macro(CheckMir)
             file(GLOB MIR_SOURCES ${SDL2_SOURCE_DIR}/src/video/mir/*.c)
             set(SOURCE_FILES ${SOURCE_FILES} ${MIR_SOURCES})
             set(SDL_VIDEO_DRIVER_MIR 1)
+            set(SDL_VIDEO_OPENGL_EGL 1)
 
             if(MIR_SHARED)
                 if(NOT HAVE_DLOPEN)
@@ -619,6 +620,7 @@ macro(CheckWayland)
       endif()
 
       set(SDL_VIDEO_DRIVER_WAYLAND 1)
+      set(SDL_VIDEO_OPENGL_EGL 1)
     endif()
   endif()
 endmacro()