CMake: Find more external libraries

Check for LibNotify, MSpack, XTest and GnomeVFS2.
This commit is contained in:
Maarten Bent
2018-12-11 20:49:14 +01:00
parent 79344fc5b6
commit 14570b4fa3
8 changed files with 304 additions and 2 deletions

View File

@@ -295,4 +295,57 @@ if(wxUSE_GUI)
wx_option_force_value(wxUSE_LIBSDL OFF)
endif()
endif()
if(wxUSE_NOTIFICATION_MESSAGE AND UNIX AND WXGTK2 AND wxUSE_LIBNOTIFY)
find_package(LibNotify)
if(NOT LIBNOTIFY_FOUND)
message(WARNING "Libnotify not found, it won't be used for notifications")
wx_option_force_value(wxUSE_LIBNOTIFY OFF)
elseif((LIBNOTIFY_VERSION GREATER 0.7) OR (LIBNOTIFY_VERSION EQUAL 0.7))
set(wxUSE_LIBNOTIFY_0_7 ON)
endif()
endif()
if(wxUSE_UIACTIONSIMULATOR AND UNIX AND WXGTK)
if(wxUSE_XTEST)
find_package(XTest)
if(XTEST_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${XTEST_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${XTEST_LIBRARIES})
else()
if(WXGTK3)
# This class can't work without XTest with GTK+ 3
# which uses XInput2 and so ignores XSendEvent().
message(STATUS "XTest not found, wxUIActionSimulator won't be available")
wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF)
endif()
# The other ports can use XSendEvent(), so don't warn
wx_option_force_value(wxUSE_XTEST OFF)
endif()
else(WXGTK3)
# As per above, wxUIActionSimulator can't be used in this case,
# but there is no need to warn, presumably the user knows what
# he's doing if wxUSE_XTEST was explicitly disabled.
wx_option_force_value(wxUSE_UIACTIONSIMULATOR OFF)
endif()
endif()
if(wxUSE_HTML AND UNIX AND wxUSE_LIBMSPACK)
find_package(MSPACK)
if(NOT MSPACK_FOUND)
message(STATUS "libmspack not found")
wx_option_force_value(wxUSE_LIBMSPACK OFF)
endif()
endif()
if(WXGTK2 AND wxUSE_MIMETYPE AND wxUSE_LIBGNOMEVFS)
find_package(GnomeVFS2)
if(GNOMEVFS2_FOUND)
list(APPEND wxTOOLKIT_INCLUDE_DIRS ${GNOMEVFS2_INCLUDE_DIRS})
list(APPEND wxTOOLKIT_LIBRARIES ${GNOMEVFS2_LIBRARIES})
else()
message(STATUS "libgnomevfs not found, library won't be used to associate MIME type")
wx_option_force_value(wxUSE_LIBGNOMEVFS OFF)
endif()
endif()
endif()