diff options
author | Bignaux Ronan <ronan@aimao.org> | 2019-05-25 22:45:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-25 22:45:36 +0200 |
commit | da3e1e0c186dfd6c6566f798811a27d001a7fb1d (patch) | |
tree | 697b30e287d5335a20a1c57283745814bc77c429 | |
parent | bbff86825991abb7408abf1691118b112c83bed2 (diff) | |
parent | 4e5b35a97ea2f2e15b9b5f361ebd3bb9094a4be1 (diff) | |
download | navit-da3e1e0c186dfd6c6566f798811a27d001a7fb1d.tar.gz |
Merge pull request #651 from bignaux/cmake
Refactoring:cmake:from 2.6 to 3.2
-rwxr-xr-x | CMakeLists.txt | 95 | ||||
-rw-r--r-- | Toolchain/mingw.cmake | 3 | ||||
-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 | ||||
-rw-r--r-- | navit/CMakeLists.txt | 14 | ||||
-rw-r--r-- | navit/binding/win32/CMakeLists.txt | 2 | ||||
-rw-r--r-- | scripts/build_wince.sh | 4 |
12 files changed, 67 insertions, 766 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 950314e72..3e6d4c683 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.2) + set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit") set(MACOSX_BUNDLE_BUNDLE_NAME "Navit") message(STATUS "Building with CMake V${CMAKE_VERSION}") @@ -11,7 +13,6 @@ if (NOT DISABLE_CXX) enable_language(CXX OPTIONAL) endif(NOT DISABLE_CXX) -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) set(NAVIT_VERSION_MAJOR "0") set(NAVIT_VERSION_MINOR "5") set(NAVIT_VERSION_PATCH "3") @@ -146,8 +147,55 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) INCLUDE (CheckFunctionExists) INCLUDE (CheckSymbolExists) -find_package(Glib) -find_package(Gmodule) + +################################ +# pkg-config based detection # +################################ + +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + pkg_check_modules ( GMODULE gmodule-2.0 ) + if (GMODULE_FOUND) + set(HAVE_GMODULE 1) + include_directories(${GMODULE_INCLUDE_DIRS}) + list(APPEND NAVIT_LIBS ${GMODULE_LIBRARIES}) + endif(GMODULE_FOUND) + + pkg_check_modules (GLIB2 glib-2.0>=2.10) + if (GLIB2_FOUND) + set(HAVE_GLIB 1) + include_directories(${GLIB2_INCLUDE_DIRS}) + list(APPEND NAVIT_LIBS ${GLIB2_LIBRARIES}) + else(GLIB2_FOUND) + set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS}) + endif(GLIB2_FOUND) + + pkg_check_modules(FONTCONFIG "fontconfig >= 2.2.0") + pkg_check_modules(DBUS "dbus-1 >= 1.4") + pkg_check_modules(DBUSGLIB dbus-glib-1) + if(DBUSGLIB_FOUND) + include_directories(${DBUSGLIB_INCLUDE_DIRS}) + set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES}) + set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES}) + set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES}) + endif() + + pkg_check_modules(LIBLOCATION liblocation) + pkg_check_modules(LIBOSSO libosso) + # Accept even old versions of libgps, because N810 uses an old version (see #1179). + pkg_check_modules(LIBGPS libgps) + pkg_check_modules(LIBGPS19 libgps>=2.90) + # libgpsd<V3.1 is buggy if LC_ALL is set. + pkg_check_modules(LIBGPS_NEW libgps>=3.1) + pkg_check_modules(LIBGARMIN libgarmin) + pkg_check_modules(IMLIB2 imlib2) + if(IMLIB2_FOUND) + set(HAVE_IMLIB2 1) + endif(IMLIB2_FOUND) +endif(PKG_CONFIG_FOUND) + +#find_package(Iconv) +#find_package(Gmodule) find_package(ZLIB) find_package(Freetype) #find_library(SDL2MAIN SDL2) @@ -162,10 +210,9 @@ find_package(GLUT) find_package(GTK2 2.6 COMPONENTS gtk) find_package(Gettext) find_package(PNG) -find_package(DBusGLib) find_package(PythonLibs) find_package(Threads) -libfind_pkg_check_modules(FONTCONFIG fontconfig) + #Qt detection if (NOT DISABLE_QT) find_package(Qt5Widgets) @@ -191,22 +238,6 @@ if (NOT DISABLE_QT) endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) endif (NOT DISABLE_QT) -#pkg-config based detection -find_package(PkgConfig) -if(PKG_CONFIG_FOUND) - pkg_check_modules(LIBLOCATION liblocation) - pkg_check_modules(LIBOSSO libosso) - # Accept even old versions of libgps, because N810 uses an old version (see #1179). - pkg_check_modules(LIBGPS libgps) - pkg_check_modules(LIBGPS19 libgps>=2.90) - # libgpsd<V3.1 is buggy if LC_ALL is set. - pkg_check_modules(LIBGPS_NEW libgps>=3.1) - pkg_check_modules(LIBGARMIN libgarmin) - pkg_check_modules(IMLIB2 imlib2) - if(IMLIB2_FOUND) - set(HAVE_IMLIB2 1) - endif(IMLIB2_FOUND) -endif(PKG_CONFIG_FOUND) #Simple checks CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP) CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H) @@ -256,18 +287,7 @@ if (CMAKE_USE_PTHREADS_INIT) list(APPEND NAVIT_LIBS pthread) endif(NOT ANDROID) endif(CMAKE_USE_PTHREADS_INIT) -if (Glib_FOUND) - set(HAVE_GLIB 1) - include_directories(${Glib_INCLUDE_DIRS}) - list(APPEND NAVIT_LIBS ${Glib_LIBRARIES}) -else(Glib_FOUND) - set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS}) -endif(Glib_FOUND) -if (Gmodule_FOUND) - set(HAVE_GMODULE 1) - include_directories(${Gmodule_INCLUDE_DIRS}) - list(APPEND NAVIT_LIBS ${Gmodule_LIBRARIES}) -endif(Gmodule_FOUND) + if(ZLIB_FOUND) set(HAVE_ZLIB 1) include_directories(${ZLIB_INCLUDE_DIRS}) @@ -288,7 +308,7 @@ if (NOT HAVE_WORDEXP) message(STATUS "wordexp.h not found. use internal wordexp") set_with_reason(support/wordexp "native wordexp missing" TRUE) endif() -if (NOT Glib_FOUND) +if (NOT GLIB2_FOUND) set_with_reason(support/ezxml "Glib not found" TRUE) endif() @@ -440,13 +460,6 @@ if (LIBGARMIN_FOUND) set_with_reason(map/garmin "Garmin library found" TRUE ${LIBGARMIN_LDFLAGS}) endif(LIBGARMIN_FOUND) -if(DBusGLib_FOUND) - include_directories(${DBusGLib_INCLUDE_DIRS}) - set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES}) - set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES}) - set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES}) -endif() - if(PYTHONLIBS_FOUND) set_with_reason(binding/python "python libraries [${PYTHONLIBS_VERSION_STRING}] found" TRUE ${PYTHON_LIBRARIES}) endif() diff --git a/Toolchain/mingw.cmake b/Toolchain/mingw.cmake index 5ade65c3b..c50c80f91 100644 --- a/Toolchain/mingw.cmake +++ b/Toolchain/mingw.cmake @@ -5,7 +5,8 @@ SET(PKG_CONFIG_EXECUTABLE ${TARGET_ARCH}-pkg-config) # unecessary according to https://cmake.org/cmake/help/v3.4/variable/WINCE.html # TODO: plateform wince change too much things for now, fix later. -if (CMAKE_SYSTEM_NAME STREQUAL "WindowsCEtest") +# WindowsCETest -> WindowsCE +if (CMAKE_SYSTEM_NAME STREQUAL "WindowsCETest") SET(CMAKE_EXECUTABLE_SUFFIX ".exe") SET(WINCE TRUE) endif() 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) - diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt index 9772d4cb8..0c4d4243d 100644 --- a/navit/CMakeLists.txt +++ b/navit/CMakeLists.txt @@ -95,15 +95,17 @@ if(NOT ANDROID) endif() endif() -if (SHARED_LIBNAVIT) - add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} ) -else(SHARED_LIBNAVIT) - add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} ) -endif(SHARED_LIBNAVIT) +#if (SHARED_LIBNAVIT) +# add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} ) +#else(SHARED_LIBNAVIT) +# add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} ) +#endif(SHARED_LIBNAVIT) + +add_library (${NAVIT_LIBNAME} ${NAVIT_SRC} ) if(NOT MSVC) SET(NAVIT_LIBS ${NAVIT_LIBS} m) endif(NOT MSVC) -target_link_libraries(${NAVIT_LIBNAME} ${MODULES_NAME} ${NAVIT_SUPPORT_LIBS} fib ${NAVIT_LIBS} ) +target_link_libraries(${NAVIT_LIBNAME} ${MODULES_NAME} ${NAVIT_SUPPORT_LIBS} fib ${NAVIT_LIBS} ) set_target_properties(${NAVIT_LIBNAME} PROPERTIES COMPILE_DEFINITIONS "MODULE=navit;LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}\";PREFIX=\"${CMAKE_INSTALL_PREFIX}\"") if (DEFINED NAVIT_COMPILE_FLAGS) set_target_properties(${NAVIT_LIBNAME} PROPERTIES COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS}") diff --git a/navit/binding/win32/CMakeLists.txt b/navit/binding/win32/CMakeLists.txt index 37b675873..37f81aec7 100644 --- a/navit/binding/win32/CMakeLists.txt +++ b/navit/binding/win32/CMakeLists.txt @@ -1,5 +1,5 @@ if (USE_LIBGNUINTL AND NOT HAVE_GLIB) - ADD_DEPENDENCIES(support_glib intl_cmake) + ADD_DEPENDENCIES(support_glib support_gettext_intl) endif() module_add_library(binding_win32 binding_win32.c) diff --git a/scripts/build_wince.sh b/scripts/build_wince.sh index f7950cc9e..bd8f6feb1 100644 --- a/scripts/build_wince.sh +++ b/scripts/build_wince.sh @@ -5,11 +5,11 @@ mkdir -p wince pushd wince # cmake \ - -DTARGET_ARCH=arm-mingw32ce -DCMAKE_SYSTEM_NAME=WindowsCEtest \ + -DTARGET_ARCH=arm-mingw32ce -DCMAKE_SYSTEM_NAME=WindowsCETest \ -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw.cmake \ -DXSLTS=windows,wince -DCACHE_SIZE=10485760 -Dsvg2png_scaling:STRING=16,32 \ -Dsvg2png_scaling_nav:STRING=32 -Dsvg2png_scaling_flag=16 -DSAMPLE_MAP=n .. -make +make VERBOSE=1 test -d output && rm -rf output mkdir output |