mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Better detection of NOT_X_WINDOWS.
When building against the Mac Homebrew installation of GTK, you find that GTK exists, libX11 exists, but the integration between the two (in the form of the header file gdk/gdkx.h) doesn't exist. In that situation, we need to compile out X11 support.
This commit is contained in:
parent
e706c04451
commit
c037aef285
@ -57,12 +57,21 @@ endif()
|
|||||||
|
|
||||||
include(cmake/gtk.cmake)
|
include(cmake/gtk.cmake)
|
||||||
|
|
||||||
|
# See if we have X11 available. This requires libX11 itself, and also
|
||||||
|
# the GDK integration to X11.
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
if(NOT X11_FOUND)
|
|
||||||
set(NOT_X_WINDOWS ON)
|
function(check_x11)
|
||||||
else()
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${GTK_INCLUDE_DIRS})
|
||||||
set(NOT_X_WINDOWS OFF)
|
check_include_file(gdk/gdkx.h HAVE_GDK_GDKX_H)
|
||||||
endif()
|
|
||||||
|
if(X11_FOUND AND HAVE_GDK_GDKX_H)
|
||||||
|
set(NOT_X_WINDOWS OFF PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(NOT_X_WINDOWS ON PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
check_x11()
|
||||||
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/charset ${GTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
|
include_directories(${CMAKE_SOURCE_DIR}/charset ${GTK_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
|
||||||
link_directories(${GTK_LIBRARY_DIRS})
|
link_directories(${GTK_LIBRARY_DIRS})
|
||||||
|
Loading…
Reference in New Issue
Block a user