CMake: move GTK+ check into wxWidgets

This commit is contained in:
Michael Maltese 2017-04-24 14:10:10 -07:00
parent 8e7648f42a
commit 6197d9622f
2 changed files with 2 additions and 24 deletions

View File

@ -795,30 +795,6 @@ if(NOT DISABLE_WX)
add_definitions(-DwxSIZE_T_IS_UINT)
endif()
if(UNIX AND NOT APPLE AND NOT HAIKU)
# There is a bug in the FindGTK module in cmake version 2.8.2 that
# does not find gdk-pixbuf-2.0. On the other hand some 2.8.3
# users have complained that pkg-config does not find
# gdk-pixbuf-2.0. On yet another hand, cmake version 2.8.3 in
# Ubuntu Natty does not find the glib libraries correctly.
# Ugly!!!
execute_process(COMMAND lsb_release -c -s
OUTPUT_VARIABLE DIST_NAME
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
check_lib(GTK2 gtk+-2.0 gtk+-2.0 gtk.h REQUIRED)
else()
find_package(GTK2)
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
list(APPEND LIBS ${GTK2_LIBRARIES})
else()
message(FATAL_ERROR "GTK is required to build the WX UI. Please install the GTK development libraries.")
endif()
endif()
endif()
if(wxWidgets_FOUND)
include(${wxWidgets_USE_FILE})
message(STATUS "wxWidgets found, enabling GUI build")

View File

@ -860,6 +860,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
if (NOT X11_xf86vmode_FOUND OR NOT X11_Xinerama_FOUND)
message(FATAL_ERROR "wxGTK2 needs Xinerama and Xxf86vm")
endif()
find_package(GTK2 REQUIRED)
target_include_directories(wx PUBLIC ${GTK2_INCLUDE_DIRS})
target_link_libraries(wx PRIVATE
png
${GTHREAD2_LIBRARIES}