From 3540054ff6c827ecfb394d6dd86f8cd3ced279ea Mon Sep 17 00:00:00 2001 From: Ahto Taat Date: Mon, 6 Nov 2017 21:44:46 +0100 Subject: [cmake] FreeBSD platform changes for 30c3e25 --- cmake/platform/freebsd/wayland.cmake | 17 +++++++++++++++++ cmake/platform/freebsd/x11.cmake | 2 ++ cmake/scripts/common/Platform.cmake | 2 +- cmake/scripts/freebsd/ExtraTargets.cmake | 29 +++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 cmake/platform/freebsd/wayland.cmake create mode 100644 cmake/platform/freebsd/x11.cmake create mode 100644 cmake/scripts/freebsd/ExtraTargets.cmake diff --git a/cmake/platform/freebsd/wayland.cmake b/cmake/platform/freebsd/wayland.cmake new file mode 100644 index 0000000000..55fbd8a940 --- /dev/null +++ b/cmake/platform/freebsd/wayland.cmake @@ -0,0 +1,17 @@ +set(PLATFORM_REQUIRED_DEPS EGL Waylandpp LibDRM Xkbcommon) +set(PLATFORM_OPTIONAL_DEPS VAAPI) + +set(WAYLAND_RENDER_SYSTEM "" CACHE STRING "Render system to use with Wayland: \"gl\" or \"gles\"") + +if(WAYLAND_RENDER_SYSTEM STREQUAL "gl") + list(APPEND PLATFORM_REQUIRED_DEPS OpenGl) +elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") + list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) +else() + message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") +endif() + +set(PLATFORM_GLOBAL_TARGET_DEPS generate-wayland-extra-protocols) +set(WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}") +# for wayland-extra-protocols.hpp +include_directories("${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}") diff --git a/cmake/platform/freebsd/x11.cmake b/cmake/platform/freebsd/x11.cmake new file mode 100644 index 0000000000..656fd66572 --- /dev/null +++ b/cmake/platform/freebsd/x11.cmake @@ -0,0 +1,2 @@ +set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM) +set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX) diff --git a/cmake/scripts/common/Platform.cmake b/cmake/scripts/common/Platform.cmake index 1889ccac43..5ac233a54d 100644 --- a/cmake/scripts/common/Platform.cmake +++ b/cmake/scripts/common/Platform.cmake @@ -2,7 +2,7 @@ if(NOT CORE_SYSTEM_NAME) string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME) endif() -if(CORE_SYSTEM_NAME STREQUAL linux) +if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) # Set default CORE_PLATFORM_NAME to X11 # This is overridden by user setting -DCORE_PLATFORM_NAME= set(_DEFAULT_PLATFORM X11) diff --git a/cmake/scripts/freebsd/ExtraTargets.cmake b/cmake/scripts/freebsd/ExtraTargets.cmake new file mode 100644 index 0000000000..66383ab727 --- /dev/null +++ b/cmake/scripts/freebsd/ExtraTargets.cmake @@ -0,0 +1,29 @@ +# xrandr +if(X_FOUND AND XRANDR_FOUND) + find_package(X QUIET) + find_package(XRandR QUIET) + add_executable(${APP_NAME_LC}-xrandr ${CMAKE_SOURCE_DIR}/xbmc-xrandr.c) + target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) +endif() + +# WiiRemote +if(ENABLE_EVENTCLIENTS AND BLUETOOTH_FOUND) + find_package(CWiid QUIET) + if(CWIID_FOUND) + add_subdirectory(${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) + endif() +endif() + +if(CORE_PLATFORM_NAME_LC STREQUAL "wayland") + # This cannot go into wayland.cmake since it requires the Wayland dependencies + # to already be resolved + set(PROTOCOL_XMLS "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml" + "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml") + add_custom_command(OUTPUT "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" + COMMAND "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.hpp" "${WAYLAND_EXTRA_PROTOCOL_GENERATED_DIR}/wayland-extra-protocols.cpp" + DEPENDS "${WAYLANDPP_SCANNER}" ${PROTOCOL_XMLS} + COMMENT "Generating wayland-protocols C++ wrappers") + + # Dummy target for dependencies + add_custom_target(generate-wayland-extra-protocols DEPENDS wayland-extra-protocols.hpp) +endif() -- cgit v1.2.3