diff options
author | Bignaux Ronan <ronan@aimao.org> | 2018-09-02 17:07:51 +0200 |
---|---|---|
committer | Bignaux Ronan <ronan@aimao.org> | 2019-05-25 14:23:26 +0200 |
commit | 4e5b35a97ea2f2e15b9b5f361ebd3bb9094a4be1 (patch) | |
tree | 697b30e287d5335a20a1c57283745814bc77c429 /cmake | |
parent | bbff86825991abb7408abf1691118b112c83bed2 (diff) | |
download | navit-4e5b35a97ea2f2e15b9b5f361ebd3bb9094a4be1.tar.gz |
Refactoring:cmake:from 2.6 to 3.2
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindDBus.cmake | 26 | ||||
-rw-r--r-- | cmake/FindDBusGLib.cmake | 23 | ||||
-rw-r--r-- | cmake/FindGTK2.cmake | 471 | ||||
-rw-r--r-- | cmake/FindGlib.cmake | 39 | ||||
-rw-r--r-- | cmake/FindGmodule.cmake | 28 | ||||
-rw-r--r-- | cmake/Findespeak.cmake | 29 | ||||
-rw-r--r-- | cmake/LibFindMacros.cmake | 99 |
7 files changed, 0 insertions, 715 deletions
diff --git a/cmake/FindDBus.cmake b/cmake/FindDBus.cmake deleted file mode 100644 index b6bbdb53d..000000000 --- a/cmake/FindDBus.cmake +++ /dev/null @@ -1,26 +0,0 @@ -include(LibFindMacros) - -libfind_pkg_check_modules(DBUS_PKGCONFIG dbus-1) - -FIND_PATH(DBus_INCLUDE_DIR dbus/dbus.h - PATHS - ${DBUS_PKGCONFIG_INCLUDE_DIRS} - /usr/include/dbus-1.0 -# PATH_SUFFIXES dbus -) - -FIND_PATH(DBus_INCLUDE_DIR_ARCH dbus/dbus-arch-deps.h - PATHS - ${DBUS_PKGCONFIG_INCLUDE_DIRS} - /usr/lib/dbus-1.0/include -# PATH_SUFFIXES dbus -) - -FIND_LIBRARY(DBus_LIBRARY - NAMES dbus-1 - PATHS ${DBUS_PKGCONFIG_LIBRARY_DIRS} -) - -set(DBus_PROCESS_INCLUDES DBus_INCLUDE_DIR DBus_INCLUDE_DIR_ARCH) -set(DBus_PROCESS_LIBS DBus_LIBRARY) -libfind_process(DBus) diff --git a/cmake/FindDBusGLib.cmake b/cmake/FindDBusGLib.cmake deleted file mode 100644 index 57bbd022a..000000000 --- a/cmake/FindDBusGLib.cmake +++ /dev/null @@ -1,23 +0,0 @@ -FIND_PACKAGE(DBus) - -include(LibFindMacros) - -libfind_pkg_check_modules(DBUS_GLIB_PKGCONFIG dbus-glib-1) - -FIND_PATH(DBusGLib_INCLUDE_DIR dbus/dbus-glib.h - PATHS - ${DBUS_GLIB_PKGCONFIG_INCLUDE_DIRS} - /usr/include/dbus-1.0 -# PATH_SUFFIXES dbus -) - -FIND_LIBRARY(DBusGLib_LIBRARY - NAMES - dbus-glib-1 - PATHS - ${DBUS_GLIB_PKGCONFIG_LIBRARY_DIRS} -) - -set(DBusGLib_PROCESS_INCLUDES DBusGLib_INCLUDE_DIR DBus_INCLUDE_DIRS) -set(DBusGLib_PROCESS_LIBS DBusGLib_LIBRARY DBus_LIBRARIES) -libfind_process(DBusGLib) diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK2.cmake deleted file mode 100644 index d538ca3e8..000000000 --- a/cmake/FindGTK2.cmake +++ /dev/null @@ -1,471 +0,0 @@ -# - Try to find GTK2 -# Once done this will define -# -# GTK2_FOUND - System has Boost -# GTK2_INCLUDE_DIRS - GTK2 include directory -# GTK2_LIBRARIES - Link these to use GTK2 -# GTK2_LIBRARY_DIRS - The path to where the GTK2 library files are. -# GTK2_DEFINITIONS - Compiler switches required for using GTK2 -# -# Copyright (c) 2007 Andreas Schneider <mail@cynapses.org> -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -# Set GTK2_DEBUG to enable debug output. -macro(GTK2_DEBUG_MESSAGE _message) - if (GTK2_DEBUG) - message(STATUS "(DEBUG) ${_message}") - endif (GTK2_DEBUG) -endmacro(GTK2_DEBUG_MESSAGE _message) - -if (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - # in cache already - set(GTK2_FOUND TRUE) -else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - include(UsePkgConfig) - - pkgconfig(gtk+-2.0 _GTK2IncDir _GTK2LinkDir _GTK2LinkFlags _GTK2Cflags) - - find_path(GTK2_GTK_INCLUDE_DIR - NAMES - gtk/gtk.h - PATHS - $ENV{GTK2_HOME} - ${_GTK2IncDir} - ${_GTK2IncDir}/gtk-2.0 - /usr/include/gtk-2.0 - /usr/local/include/gtk-2.0 - /opt/include/gtk-2.0 - /opt/gnome/include/gtk-2.0 - /sw/include/gtk-2.0 - ) - gtk2_debug_message("GTK2_GTK_INCLUDE_DIR is ${GTK2_GTK_INCLUDE_DIR}") - - # Some Linux distributions (e.g. Red Hat) have glibconfig.h - # and glib.h in different directories, so we need to look - # for both. - # - Atanas Georgiev <atanas@cs.columbia.edu> - pkgconfig(glib-2.0 _GLIB2IncDir _GLIB2LinkDir _GLIB2LinkFlags _GLIB2Cflags) - pkgconfig(gmodule-2.0 _GMODULE2IncDir _GMODULE2LinkDir _GMODULE2LinkFlags _GMODULE2Cflags) - - find_path(GTK2_GLIBCONFIG_INCLUDE_DIR - NAMES - glibconfig.h - PATHS - ${_GLIB2IncDir} - ${_GMODULE2IncDir} - ${_GMODULE2IncDir}/glib-2.0 - ${_GLIB2LinkDir}/glib-2.0/include - /opt/gnome/lib64/glib-2.0/include - /opt/gnome/lib/glib-2.0/include - /opt/lib/glib-2.0/include - /usr/lib64/glib-2.0/include - /usr/lib/glib-2.0/include - /sw/lib/glib-2.0/include - ) - gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}") - - find_path(GTK2_GLIB_INCLUDE_DIR - NAMES - glib.h - PATHS - ${_GLIB2IncDir} - ${_GLIB2IncDir}/glib-2.0 - ${_GMODULE2IncDir} - /opt/include/glib-2.0 - /opt/gnome/include/glib-2.0 - /usr/include/glib-2.0 - /sw/include/glib-2.0 - ) - gtk2_debug_message("GTK2_GLIB_INCLUDE_DIR is ${GTK2_GLIB_INCLUDE_DIR}") - - pkgconfig(gdk-2.0 _GDK2IncDir _GDK2LinkDir _GDK2LinkFlags _GDK2Cflags) - - find_path(GTK2_GDK_INCLUDE_DIR - NAMES - gdkconfig.h - PATHS - ${_GDK2IncDir} - ${_GDK2IncDir}/gtk-2.0 - ${_GDK2LinkDir}/gtk-2.0/include - /opt/gnome/lib/gtk-2.0/include - /opt/gnome/lib64/gtk-2.0/include - /opt/lib/gtk-2.0/include - /usr/lib/gtk-2.0/include - /usr/lib64/gtk-2.0/include - /sw/lib/gtk-2.0/include - ) - gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}") - - find_path(GTK2_GTKGL_INCLUDE_DIR - NAMES - gtkgl/gtkglarea.h - PATHS - ${_GLIB2IncDir} - /usr/include - /usr/local/include - /usr/openwin/share/include - /opt/gnome/include - /opt/include - /sw/include - ) - gtk2_debug_message("GTK2_GTKGL_INCLUDE_DIR is ${GTK2_GTKGL_INCLUDE_DIR}") - - pkgconfig(pango _PANGOIncDir _PANGOLinkDir _PANGOLinkFlags _PANGOCflags) - - find_path(GTK2_PANGO_INCLUDE_DIR - NAMES - pango/pango.h - PATHS - ${_PANGOIncDir} - ${_PANGOIncDir}/pango-1.0/ - /usr/include/pango-1.0 - /opt/gnome/include/pango-1.0 - /opt/include/pango-1.0 - /sw/include/pango-1.0 - ) - gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}") - - pkgconfig(cairo _CAIROIncDir _CAIROLinkDir _CAIROLinkFlags _CAIROCflags) - - find_path(GTK2_CAIRO_INCLUDE_DIR - NAMES - cairo.h - PATHS - ${_CAIROIncDir} - ${_CAIROIncDir}/cairo - /opt/gnome/include/cairo - /usr/include - /usr/include/cairo - /opt/include - /opt/include/cairo - /sw/include - /sw/include/cairo - ) - gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}") - - pkgconfig(gdk-pixbuf-2.0 _GDKPIXBUFIncDir _GDKPIXBUFLinkDir _GDKPIXBUFLinkFlags _GDKPIXBUFCflags) - - find_path(GTK2_GDKPIXBUF_INCLUDE_DIR - NAMES - gdk-pixbuf/gdk-pixbuf.h - PATHS - ${_GDKPIXBUFIncDir} - ${_GDKPIXBUFIncDir}/gdk-pixbuf-2.0 - /opt/gnome/include/cairo - /usr/include - /usr/include/cairo - /opt/include - /opt/include/cairo - /sw/include - /sw/include/cairo - /sw/include/gdk-pixbuf-2.0 - ) - gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}") - - pkgconfig(atk _ATKIncDir _ATKLinkDir _ATKLinkFlags _ATKCflags) - - find_path(GTK2_ATK_INCLUDE_DIR - NAMES - atk/atk.h - PATHS - ${_ATKIncDir} - ${_ATKIncDir}/atk-1.0 - /opt/gnome/include/atk-1.0 - /usr/include/atk-1.0 - /opt/include/atk-1.0 - /sw/include/atk-1.0 - ) - gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}") - if (UNIX) - find_library(GTK2_GTK_LIBRARY - NAMES - gtk-x11-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}") - - find_library(GTK2_GDK_LIBRARY - NAMES - gdk-x11-2.0 - PATHS - ${_GDK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GDK_LIBRARY is ${GTK2_GDK_LIBRARY}") - endif(UNIX) - if (WIN32) - - find_library(GTK2_GTK_LIBRARY - NAMES - gtk-win32-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}") - - find_library(GTK2_GDK_LIBRARY - NAMES - gdk-win32-2.0 - PATHS - ${_GDK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - endif (WIN32) - find_library(GTK2_GDK_PIXBUF_LIBRARY - NAMES - gdk_pixbuf-2.0 - PATHS - ${_GDK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}") - - find_library(GTK2_GMODULE_LIBRARY - NAMES - gmodule-2.0 - PATHS - ${_GMODULE2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GMODULE_LIBRARY is ${GTK2_GMODULE_LIBRARY}") - - find_library(GTK2_GTHREAD_LIBRARY - NAMES - gthread-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTHREAD_LIBRARY is ${GTK2_GTHREAD_LIBRARY}") - - find_library(GTK2_GOBJECT_LIBRARY - NAMES - gobject-2.0 - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GOBJECT_LIBRARY is ${GTK2_GOBJECT_LIBRARY}") - - find_library(GTK2_GLIB_LIBRARY - NAMES - glib-2.0 - PATHS - ${_GLIB2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GLIB_LIBRARY is ${GTK2_GLIB_LIBRARY}") - - find_library(GTK2_GTKGL_LIBRARY - NAMES - gtkgl - PATHS - ${_GTK2LinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_GTKGL_LIBRARY is ${GTK2_GTKGL_LIBRARY}") - - find_library(GTK2_PANGO_LIBRARY - NAMES - pango-1.0 - PATHS - ${_PANGOLinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_PANGO_LIBRARY}") - - find_library(GTK2_CAIRO_LIBRARY - NAMES - pangocairo-1.0 - PATHS - ${_CAIROLinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_CAIRO_LIBRARY}") - - find_library(GTK2_ATK_LIBRARY - NAMES - atk-1.0 - PATHS - ${_ATKinkDir} - /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib - /opt/lib - /sw/lib - ) - gtk2_debug_message("GTK2_ATK_LIBRARY is ${GTK2_ATK_LIBRARY}") - - set(GTK2_INCLUDE_DIRS - ${GTK2_GTK_INCLUDE_DIR} - ${GTK2_GLIBCONFIG_INCLUDE_DIR} - ${GTK2_GLIB_INCLUDE_DIR} - ${GTK2_GDK_INCLUDE_DIR} - ${GTK2_PANGO_INCLUDE_DIR} - ${GTK2_CAIRO_INCLUDE_DIR} - ${GTK2_ATK_INCLUDE_DIR} - ) - - if(GTK2_GDKPIXBUF_INCLUDE_DIR) - set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${GTK2_GDKPIXBUF_INCLUDE_DIR}) - endif(GTK2_GDKPIXBUF_INCLUDE_DIR) - - if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - if (GTK2_GMODULE_LIBRARY) - if (GTK2_GTHREAD_LIBRARY) - if (GTK2_GOBJECT_LIBRARY) - if (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - if (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - if (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - - # set GTK2 libraries - set (GTK2_LIBRARIES - ${GTK2_GTK_LIBRARY} - ${GTK2_GDK_LIBRARY} - ${GTK2_GDK_PIXBUF_LIBRARY} - ${GTK2_GMODULE_LIBRARY} - ${GTK2_GTHREAD_LIBRARY} - ${GTK2_GOBJECT_LIBRARY} - ${GTK2_PANGO_LIBRARY} - ${GTK2_CAIRO_LIBRARY} - ${GTK2_ATK_LIBRARY} - ) - - # check for gtkgl support - if (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR) - set(GTK2_GTKGL_FOUND TRUE) - -# set(GTK2_INCLUDE_DIRS -# ${GTK2_INCLUDE_DIRS} -# ${GTK2_GTKGL_INCLUDE_DIR} -# ) - -# set(GTK2_LIBRARIES -# ${GTK2_LIBRARIES} -# ${GTK2_GTKGL_LIBRARY} -# ) - endif (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR) - - else (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - endif (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR) - else (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - endif (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR) - else (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - endif (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR) - else (GTK2_GOBJECT_LIBRARY) - endif (GTK2_GOBJECT_LIBRARY) - else (GTK2_GTHREAD_LIBRARY) - endif (GTK2_GTHREAD_LIBRARY) - else (GTK2_GMODULE_LIBRARY) - endif (GTK2_GMODULE_LIBRARY) - else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR) - else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR) - - - if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES) - set(GTK2_FOUND TRUE) - endif (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES) - - if (GTK2_FOUND) - if (NOT GTK2_FIND_QUIETLY) - message(STATUS "Found GTK2: ${GTK2_LIBRARIES}") - endif (NOT GTK2_FIND_QUIETLY) - else (GTK2_FOUND) - if (GTK2_FIND_REQUIRED) - message(FATAL_ERROR "Could not find GTK2") - endif (GTK2_FIND_REQUIRED) - endif (GTK2_FOUND) - - # show the GTK2_INCLUDE_DIRS and GTK2_LIBRARIES variables only in the advanced view - mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES) - - -endif (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS) - diff --git a/cmake/FindGlib.cmake b/cmake/FindGlib.cmake deleted file mode 100644 index 43414ff54..000000000 --- a/cmake/FindGlib.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# - Try to find Glib-2.0 (with gobject) -# Once done, this will define -# -# Glib_FOUND - system has Glib -# Glib_INCLUDE_DIRS - the Glib include directories -# Glib_LIBRARIES - link these to use Glib - -include(LibFindMacros) - -# Use pkg-config to get hints about paths -libfind_pkg_check_modules(Glib_PKGCONF glib-2.0) - -# Main include dir -find_path(Glib_INCLUDE_DIR - NAMES glib.h - PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /sw/include - PATH_SUFFIXES glib-2.0 -) - -# Glib-related libraries also use a separate config header, which is in lib dir -find_path(GlibConfig_INCLUDE_DIR - NAMES glibconfig.h - PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr /sw - PATH_SUFFIXES lib/glib-2.0/include -) - -# Finally the library itself -find_library(Glib_LIBRARY - NAMES glib-2.0 - PATHS ${Glib_PKGCONF_LIBRARY_DIRS} /sw/lib -) - -# Set the include dir variables and the libraries and let libfind_process do the rest. -# NOTE: Singular variables for this library, plural for libraries this this lib depends on. -set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR) -set(Glib_PROCESS_LIBS Glib_LIBRARY) -libfind_process(Glib) - - diff --git a/cmake/FindGmodule.cmake b/cmake/FindGmodule.cmake deleted file mode 100644 index 2d5ddd0bb..000000000 --- a/cmake/FindGmodule.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# - Try to find Glib-2.0 (with gobject) -# Once done, this will define -# -# Glib_FOUND - system has Glib -# Glib_INCLUDE_DIRS - the Glib include directories -# Glib_LIBRARIES - link these to use Glib - -include(LibFindMacros) - -libfind_pkg_check_modules(Gmodule_PKGCONF gmodule-2.0) -# Main include dir -find_path(Gmodule_INCLUDE_DIR - NAMES gmodule.h - PATHS ${Gmodule_PKGCONF_INCLUDE_DIRS} - PATH_SUFFIXES gmodule-2.0 -) - -# Finally the modulerary itself -find_library(Gmodule_LIBRARY - NAMES gmodule-2.0 - PATHS ${Gmodule_PKGCONF_LIBRARY_DIRS} -) - -# Set the include dir variables and the libraries and let libfind_process do the rest. -# NOTE: Singular variables for this library, plural for libraries this this lib depends on. -set(Gmodule_PROCESS_INCLUDES Gmodule_INCLUDE_DIR) -set(Gmodule_PROCESS_LIBS Gmodule_LIBRARY) -libfind_process(Gmodule) diff --git a/cmake/Findespeak.cmake b/cmake/Findespeak.cmake deleted file mode 100644 index 6d390a9a8..000000000 --- a/cmake/Findespeak.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# - Try to find espeak (with libespeak) -# Once done, this will define -# -# espeak_FOUND - system has Glib -# espeak_INCLUDE_DIRS - the Glib include directories -# espeak_LIBRARIES - link these to use Glib - -include(LibFindMacros) - -# espeak-related libraries -find_path(espeak_INCLUDE_DIR - NAMES speak_lib.h - PATHS /usr /sw/include - PATH_SUFFIXES espeak -) - -# Finally the library itself -find_library(espeak_LIBRARY - NAMES libespeak.so libespeak.a - PATHS /sw/lib -) - -# Set the include dir variables and the libraries and let libfind_process do the rest. -# NOTE: Singular variables for this library, plural for libraries this this lib depends on. -set(espeak_PROCESS_INCLUDES espeak_INCLUDE_DIR) -set(espeak_PROCESS_LIBS espeak_LIBRARY) -libfind_process(espeak) - - diff --git a/cmake/LibFindMacros.cmake b/cmake/LibFindMacros.cmake deleted file mode 100644 index 69975c51b..000000000 --- a/cmake/LibFindMacros.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments -# used for the current package. For this to work, the first parameter must be the -# prefix of the current package, then the prefix of the new package etc, which are -# passed to find_package. -macro (libfind_package PREFIX) - set (LIBFIND_PACKAGE_ARGS ${ARGN}) - if (${PREFIX}_FIND_QUIETLY) - set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET) - endif (${PREFIX}_FIND_QUIETLY) - if (${PREFIX}_FIND_REQUIRED) - set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED) - endif (${PREFIX}_FIND_REQUIRED) - find_package(${LIBFIND_PACKAGE_ARGS}) -endmacro (libfind_package) - -# CMake developers made the UsePkgConfig system deprecated in the same release (2.6) -# where they added pkg_check_modules. Consequently I need to support both in my scripts -# to avoid those deprecated warnings. Here's a helper that does just that. -# Works identically to pkg_check_modules, except that no checks are needed prior to use. -macro (libfind_pkg_check_modules PREFIX PKGNAME) - if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - include(UsePkgConfig) - pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS) - else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) - find_package(PkgConfig) - if (PKG_CONFIG_FOUND) - pkg_check_modules(${PREFIX} ${PKGNAME}) - endif (PKG_CONFIG_FOUND) - endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) -endmacro (libfind_pkg_check_modules) - -# Do the final processing once the paths have been detected. -# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain -# all the variables, each of which contain one include directory. -# Ditto for ${PREFIX}_PROCESS_LIBS and library files. -# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES. -# Also handles errors in case library detection was required, etc. -macro (libfind_process PREFIX) - # Skip processing if already processed during this run - if (NOT ${PREFIX}_FOUND) - # Start with the assumption that the library was found - set (${PREFIX}_FOUND TRUE) - - # Process all includes and set _FOUND to false if any are missing - foreach (i ${${PREFIX}_PROCESS_INCLUDES}) - if (${i}) - set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}}) - mark_as_advanced(${i}) - else (${i}) - set (${PREFIX}_FOUND FALSE) - endif (${i}) - endforeach (i) - - # Process all libraries and set _FOUND to false if any are missing - foreach (i ${${PREFIX}_PROCESS_LIBS}) - if (${i}) - set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}}) - mark_as_advanced(${i}) - else (${i}) - set (${PREFIX}_FOUND FALSE) - endif (${i}) - endforeach (i) - - # Print message and/or exit on fatal error - if (${PREFIX}_FOUND) - if (NOT ${PREFIX}_FIND_QUIETLY) - message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}") - endif (NOT ${PREFIX}_FIND_QUIETLY) - else (${PREFIX}_FOUND) - if (${PREFIX}_FIND_REQUIRED) - foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS}) - message("${i}=${${i}}") - endforeach (i) - message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.") - endif (${PREFIX}_FIND_REQUIRED) - endif (${PREFIX}_FOUND) - endif (NOT ${PREFIX}_FOUND) -endmacro (libfind_process) - -macro(libfind_library PREFIX basename) - set(TMP "") - if(MSVC80) - set(TMP -vc80) - endif(MSVC80) - if(MSVC90) - set(TMP -vc90) - endif(MSVC90) - set(${PREFIX}_LIBNAMES ${basename}${TMP}) - if(${ARGC} GREATER 2) - set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2}) - string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES}) - set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP}) - endif(${ARGC} GREATER 2) - find_library(${PREFIX}_LIBRARY - NAMES ${${PREFIX}_LIBNAMES} - PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS} - ) -endmacro(libfind_library) - |