Don't require X11 in CMake builds using Wayland-only GTK
X11 headers and libraries are only required if we're actually using X11 which may not be the case. This allows to build wxGTK on the systems using Wayland-only GTK.
This commit is contained in:
@@ -69,12 +69,6 @@ set(wxTOOLKIT_INCLUDE_DIRS)
|
||||
set(wxTOOLKIT_LIBRARIES)
|
||||
set(wxTOOLKIT_VERSION)
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT WIN32)
|
||||
find_package(X11 REQUIRED)
|
||||
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${X11_INCLUDE_DIR})
|
||||
list(APPEND wxTOOLKIT_LIBRARIES ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WXGTK)
|
||||
if(WXGTK4)
|
||||
set(gtk_lib GTK4)
|
||||
@@ -121,6 +115,15 @@ if(WXGTK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# We need X11 for non-GTK Unix ports (X11, Motif) and for GTK with X11
|
||||
# support, but not for Wayland-only GTK (which is why we have to do this after
|
||||
# find_package(GTKx) above, as this is what sets wxHAVE_GDK_X11).
|
||||
if(UNIX AND NOT APPLE AND NOT WIN32 AND (WXX11 OR WXMOTIF OR (WXGTK AND wxHAVE_GDK_X11)))
|
||||
find_package(X11 REQUIRED)
|
||||
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${X11_INCLUDE_DIR})
|
||||
list(APPEND wxTOOLKIT_LIBRARIES ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WXQT)
|
||||
set(QT_COMPONENTS Core Widgets Gui OpenGL Test)
|
||||
foreach(QT_COMPONENT ${QT_COMPONENTS})
|
||||
|
Reference in New Issue
Block a user