Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/ghost/CMakeLists.txt')
-rw-r--r--intern/ghost/CMakeLists.txt186
1 files changed, 90 insertions, 96 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index c681dc368bb..ea21d831b0c 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -4,13 +4,13 @@
set(INC
.
../clog
- ../glew-mx
+ ../../source/blender/blenlib
../../source/blender/imbuf
../../source/blender/makesdna
)
set(INC_SYS
- ${GLEW_INCLUDE_PATH}
+ ${Epoxy_INCLUDE_DIRS}
)
set(SRC
@@ -25,6 +25,7 @@ set(SRC
intern/GHOST_ISystemPaths.cpp
intern/GHOST_ModifierKeys.cpp
intern/GHOST_Path-api.cpp
+ intern/GHOST_PathUtils.cpp
intern/GHOST_Rect.cpp
intern/GHOST_System.cpp
intern/GHOST_TimerManager.cpp
@@ -59,6 +60,7 @@ set(SRC
intern/GHOST_EventTrackpad.h
intern/GHOST_EventWheel.h
intern/GHOST_ModifierKeys.h
+ intern/GHOST_PathUtils.h
intern/GHOST_System.h
intern/GHOST_SystemPaths.h
intern/GHOST_TimerManager.h
@@ -71,8 +73,7 @@ set(SRC
)
set(LIB
- bf_intern_glew_mx
- ${GLEW_LIBRARY}
+ ${Epoxy_LIBRARIES}
)
if(WITH_GHOST_DEBUG)
@@ -102,42 +103,39 @@ if(WITH_INPUT_NDOF)
)
endif()
-if(WITH_HEADLESS OR WITH_GHOST_SDL)
- if(WITH_HEADLESS)
- list(APPEND SRC
- intern/GHOST_DisplayManagerNULL.h
- intern/GHOST_SystemNULL.h
- intern/GHOST_WindowNULL.h
+list(APPEND SRC
+ intern/GHOST_DisplayManagerNULL.h
+ intern/GHOST_SystemHeadless.h
+ intern/GHOST_WindowNULL.h
+)
+
+if(WITH_HEADLESS)
+ add_definitions(-DWITH_HEADLESS)
+elseif (WITH_GHOST_SDL)
+ list(APPEND SRC
+ intern/GHOST_ContextSDL.cpp
+ intern/GHOST_DisplayManagerSDL.cpp
+ intern/GHOST_SystemSDL.cpp
+ intern/GHOST_WindowSDL.cpp
+
+ intern/GHOST_ContextSDL.h
+ intern/GHOST_DisplayManagerSDL.h
+ intern/GHOST_SystemSDL.h
+ intern/GHOST_WindowSDL.h
+ )
+ add_definitions(-DWITH_GHOST_SDL)
+
+ list(APPEND INC_SYS
+ ${SDL_INCLUDE_DIR}
+ )
+ if(WITH_SDL_DYNLOAD)
+ list(APPEND LIB
+ extern_sdlew
)
- add_definitions(-DWITH_HEADLESS)
else()
- list(APPEND SRC
- intern/GHOST_ContextSDL.cpp
- intern/GHOST_DisplayManagerSDL.cpp
- intern/GHOST_SystemSDL.cpp
- intern/GHOST_WindowSDL.cpp
-
- intern/GHOST_ContextSDL.h
- intern/GHOST_DisplayManagerSDL.h
- intern/GHOST_SystemSDL.h
- intern/GHOST_WindowSDL.h
+ list(APPEND LIB
+ ${SDL_LIBRARY}
)
- add_definitions(-DWITH_GHOST_SDL)
- endif()
-
- if(NOT WITH_HEADLESS)
- list(APPEND INC_SYS
- ${SDL_INCLUDE_DIR}
- )
- if(WITH_SDL_DYNLOAD)
- list(APPEND LIB
- extern_sdlew
- )
- else()
- list(APPEND LIB
- ${SDL_LIBRARY}
- )
- endif()
endif()
elseif(APPLE AND NOT WITH_GHOST_X11)
@@ -155,13 +153,11 @@ elseif(APPLE AND NOT WITH_GHOST_X11)
intern/GHOST_WindowViewCocoa.h
)
- if(NOT WITH_GL_EGL)
- list(APPEND SRC
- intern/GHOST_ContextCGL.mm
+ list(APPEND SRC
+ intern/GHOST_ContextCGL.mm
- intern/GHOST_ContextCGL.h
- )
- endif()
+ intern/GHOST_ContextCGL.h
+ )
if(WITH_INPUT_NDOF)
list(APPEND SRC
@@ -195,13 +191,11 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
intern/GHOST_WindowX11.h
)
- if(NOT WITH_GL_EGL)
- list(APPEND SRC
- intern/GHOST_ContextGLX.cpp
+ list(APPEND SRC
+ intern/GHOST_ContextGLX.cpp
- intern/GHOST_ContextGLX.h
- )
- endif()
+ intern/GHOST_ContextGLX.h
+ )
if(WITH_GHOST_XDND)
add_definitions(-DWITH_XDND)
@@ -248,10 +242,6 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
)
endif()
- if(WITH_X11_ALPHA)
- add_definitions(-DWITH_X11_ALPHA)
- endif()
-
if(WITH_X11_XINPUT)
add_definitions(-DWITH_X11_XINPUT)
list(APPEND INC_SYS
@@ -272,32 +262,50 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
${xkbcommon_INCLUDE_DIRS}
${wayland-cursor_INCLUDE_DIRS}
)
+ list(APPEND LIB
+ ${xkbcommon_LINK_LIBRARIES}
+ )
if(WITH_GHOST_WAYLAND_DYNLOAD)
list(APPEND INC_SYS
- ../../intern/wayland_dynload/extern
+ ../wayland_dynload/extern
)
list(APPEND LIB
bf_intern_wayland_dynload
)
add_definitions(-DWITH_GHOST_WAYLAND_DYNLOAD)
+ else()
+ list(APPEND LIB
+ ${wayland-client_LINK_LIBRARIES}
+ ${wayland-egl_LINK_LIBRARIES}
+ ${wayland-cursor_LINK_LIBRARIES}
+ )
endif()
if(WITH_GHOST_WAYLAND_DBUS)
list(APPEND INC_SYS
${dbus_INCLUDE_DIRS}
)
+ list(APPEND LIB
+ ${dbus_LINK_LIBRARIES}
+ )
endif()
if(WITH_GHOST_WAYLAND_LIBDECOR)
list(APPEND INC_SYS
${libdecor_INCLUDE_DIRS}
)
+ if(NOT WITH_GHOST_WAYLAND_DYNLOAD)
+ list(APPEND LIB
+ ${libdecor_LIBRARIES}
+ )
+ endif()
endif()
include(CheckSymbolExists)
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
+ unset(CMAKE_REQUIRED_DEFINITIONS)
if(HAVE_MEMFD_CREATE)
add_definitions(-DHAVE_MEMFD_CREATE)
endif()
@@ -308,25 +316,10 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
intern/GHOST_SystemWayland.h
intern/GHOST_WaylandCursorSettings.h
+ intern/GHOST_WaylandUtils.h
intern/GHOST_WindowWayland.h
)
- pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
-
- pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
- if(${wayland-protocols_FOUND})
- pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
- else()
- find_path(WAYLAND_PROTOCOLS_DIR
- NAMES unstable/xdg-decoration/xdg-decoration-unstable-v1.xml
- PATH_SUFFIXES share/wayland-protocols
- )
- endif()
-
- if(NOT EXISTS ${WAYLAND_PROTOCOLS_DIR})
- message(FATAL_ERROR "path to wayland-protocols not found")
- endif()
-
set(INC_DST ${CMAKE_CURRENT_BINARY_DIR}/libwayland)
# Generate protocols bindings.
@@ -356,16 +349,16 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
${INC_DST}
)
- if(NOT WITH_GHOST_WAYLAND_LIBDECOR)
- # `xdg-shell`.
- generate_protocol_bindings(
- "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml"
- )
- # `xdg-decoration`.
- generate_protocol_bindings(
- "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
- )
- endif()
+ # Used when: LIBDECOR is not needed.
+ # `xdg-shell`.
+ generate_protocol_bindings(
+ "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml"
+ )
+ # `xdg-decoration`.
+ generate_protocol_bindings(
+ "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
+ )
+ # End LIBDECOR alternative.
# `xdg-output`.
generate_protocol_bindings(
@@ -379,14 +372,22 @@ elseif(WITH_GHOST_X11 OR WITH_GHOST_WAYLAND)
generate_protocol_bindings(
"${WAYLAND_PROTOCOLS_DIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
)
+ # Pointer-gestures (multi-touch).
+ generate_protocol_bindings(
+ "${WAYLAND_PROTOCOLS_DIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml"
+ )
# Tablet.
generate_protocol_bindings(
"${WAYLAND_PROTOCOLS_DIR}/unstable/tablet/tablet-unstable-v2.xml"
)
-
- add_definitions(-DWITH_GHOST_WAYLAND)
+ # Primary-selection.
+ generate_protocol_bindings(
+ "${WAYLAND_PROTOCOLS_DIR}/unstable/primary-selection/primary-selection-unstable-v1.xml"
+ )
unset(INC_DST)
+
+ add_definitions(-DWITH_GHOST_WAYLAND)
endif()
if(WITH_INPUT_NDOF)
@@ -431,13 +432,11 @@ elseif(WIN32)
intern/GHOST_Wintab.h
)
- if(NOT WITH_GL_EGL)
- list(APPEND SRC
- intern/GHOST_ContextWGL.cpp
+ list(APPEND SRC
+ intern/GHOST_ContextWGL.cpp
- intern/GHOST_ContextWGL.h
- )
- endif()
+ intern/GHOST_ContextWGL.h
+ )
if(WITH_INPUT_IME)
add_definitions(-DWITH_INPUT_IME)
@@ -458,7 +457,7 @@ elseif(WIN32)
endif()
endif()
-if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
+if(UNIX AND NOT APPLE)
list(APPEND SRC
intern/GHOST_ContextEGL.cpp
@@ -548,11 +547,8 @@ if(WITH_XR_OPENXR)
list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_WAYLAND)
endif()
if(WITH_GHOST_X11)
- if(WITH_GL_EGL)
- list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL)
- else()
- list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB)
- endif()
+ list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_EGL)
+ list(APPEND XR_PLATFORM_DEFINES -DXR_USE_PLATFORM_XLIB)
endif()
endif()
@@ -561,6 +557,4 @@ if(WITH_XR_OPENXR)
unset(XR_PLATFORM_DEFINES)
endif()
-add_definitions(${GL_DEFINITIONS})
-
blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")