diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-21 02:11:30 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-21 09:08:03 +0300 |
commit | beaae4533a634f667bdf8c50285fb6dd3aabeca9 (patch) | |
tree | a8b4e912f6a60ce21cfba2c6209321534b229a95 /intern/ghost/CMakeLists.txt | |
parent | 84315368efa263454b85d0944248962ffa2cf479 (diff) |
Cleanup: use full names for generated wayland headers, use own directory
Instead of providing our own names for wayland headers, use the filename
component as the basis for the header names. This matches most reference
documentation for Wayland.
Also generate client protocols into a sub-directory `libwayland`,
instead of generating headers into the ghost directory. Making the
include path more specific & makes it easier to differentiate generated
headers from other build files.
Diffstat (limited to 'intern/ghost/CMakeLists.txt')
-rw-r--r-- | intern/ghost/CMakeLists.txt | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 5b06b5d98e6..945b3261562 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -303,59 +303,63 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND) message(FATAL_ERROR "path to wayland-protocols not found") endif() + set(INC_DST ${CMAKE_CURRENT_BINARY_DIR}/libwayland) + # Generate protocols bindings. - macro(generate_protocol_bindings NAME PROT_DEF) + macro(generate_protocol_bindings PROT_DEF) + # File name without directory or extension (use for header name). + get_filename_component(_name ${PROT_DEF} NAME_WLE) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}-client-protocol.h - COMMAND ${WAYLAND_SCANNER} client-header ${PROT_DEF} ${NAME}-client-protocol.h + OUTPUT ${INC_DST}/${_name}-client-protocol.h + COMMAND ${CMAKE_COMMAND} -E make_directory ${INC_DST} + COMMAND ${WAYLAND_SCANNER} client-header ${PROT_DEF} ${INC_DST}/${_name}-client-protocol.h ) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}-client-protocol.c - COMMAND ${WAYLAND_SCANNER} private-code ${PROT_DEF} ${NAME}-client-protocol.c - DEPENDS ${NAME}-client-protocol.h + OUTPUT ${INC_DST}/${_name}-client-protocol.c + COMMAND ${CMAKE_COMMAND} -E make_directory ${INC_DST} + COMMAND ${WAYLAND_SCANNER} private-code ${PROT_DEF} ${INC_DST}/${_name}-client-protocol.c + DEPENDS ${INC_DST}/${_name}-client-protocol.h ) list(APPEND SRC - ${CMAKE_CURRENT_BINARY_DIR}/${NAME}-client-protocol.c - ${CMAKE_CURRENT_BINARY_DIR}/${NAME}-client-protocol.h + ${INC_DST}/${_name}-client-protocol.c + ${INC_DST}/${_name}-client-protocol.h ) + unset(_name) endmacro() + list(APPEND INC_SYS - ${CMAKE_CURRENT_BINARY_DIR} + ${INC_DST} ) # `xdg-shell`. generate_protocol_bindings( - xdg-shell "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml" ) # `xdg-decoration`. generate_protocol_bindings( - xdg-decoration "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml" ) # `xdg-output`. generate_protocol_bindings( - xdg-output "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-output/xdg-output-unstable-v1.xml" ) # Pointer-constraints. generate_protocol_bindings( - pointer-constraints "${WAYLAND_PROTOCOLS_DIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml" ) # Relative-pointer. generate_protocol_bindings( - relative-pointer "${WAYLAND_PROTOCOLS_DIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml" ) # Tablet. generate_protocol_bindings( - tablet "${WAYLAND_PROTOCOLS_DIR}/unstable/tablet/tablet-unstable-v2.xml" ) add_definitions(-DWITH_GHOST_WAYLAND) + + unset(INC_DST) endif() if(WITH_INPUT_NDOF) |