From 2a103031eb73c1180287a176e7e9d2e006729329 Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Fri, 25 May 2018 22:07:28 -0700 Subject: cleanup:cmake:retab all CMakeLists.txt files --- CMakeLists.txt | 918 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 459 insertions(+), 459 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index db4e234b6..74a2a292e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,10 @@ project(navit C) # Workaround for CMake issue 8345 / 9220, see http://trac.navit-project.org/ticket/1041 if(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$") - set(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-NOTFOUND) + set(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-NOTFOUND) endif(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$") if (NOT DISABLE_CXX) - enable_language(CXX OPTIONAL) + enable_language(CXX OPTIONAL) endif(NOT DISABLE_CXX) cmake_minimum_required(VERSION 2.6 FATAL_ERROR) @@ -25,7 +25,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") include("${PROJECT_SOURCE_DIR}/cmake/navit_macros.cmake") IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) + SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) # binary name @@ -43,26 +43,26 @@ set(MAN_DIR share/man/man1 CACHE PATH "Navit man path") add_definitions ("-DMAN_DIR=\"${MAN_DIR}\"") # LIB_DIR IF(UNIX AND NOT ANDROID AND NOT APPLE) - IF (NOT LIBDIR) - MESSAGE(STATUS "LIBDIR variable is not defined. It will be autodetected now.") - MESSAGE(STATUS "You can set it manually with -DLIBDIR=") - # check 64 bit - IF (CMAKE_SIZEOF_VOID_P EQUAL 4) - SET(LIB_DIR lib/navit CACHE PATH "Navit 32bit bin path") - MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") - ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4) - SET(LIB_DIR lib64/navit CACHE PATH "Navit 64bit bin path") - MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") - ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4) - ELSE (NOT LIBDIR) - GET_FILENAME_COMPONENT (LIB_DIR ${LIBDIR} NAME) - MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") - ENDIF (NOT LIBDIR) + IF (NOT LIBDIR) + MESSAGE(STATUS "LIBDIR variable is not defined. It will be autodetected now.") + MESSAGE(STATUS "You can set it manually with -DLIBDIR=") + # check 64 bit + IF (CMAKE_SIZEOF_VOID_P EQUAL 4) + SET(LIB_DIR lib/navit CACHE PATH "Navit 32bit bin path") + MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") + ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4) + SET(LIB_DIR lib64/navit CACHE PATH "Navit 64bit bin path") + MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") + ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4) + ELSE (NOT LIBDIR) + GET_FILENAME_COMPONENT (LIB_DIR ${LIBDIR} NAME) + MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'") + ENDIF (NOT LIBDIR) ELSE (UNIX AND NOT ANDROID AND NOT APPLE) SET(LIB_DIR lib/navit CACHE PATH "Navit unix bin path") ENDIF (UNIX AND NOT ANDROID AND NOT APPLE) foreach(EXTRA_MODULE ${EXTRA_MODULES}) - add_module(${EXTRA_MODULE} "extra module specified" TRUE) + add_module(${EXTRA_MODULE} "extra module specified" TRUE) endforeach() add_definitions ("-DLIB_DIR=\"${LIB_DIR}\"") @@ -71,11 +71,11 @@ if (EXTRA_LIBS) endif(EXTRA_LIBS) if (EXTRA_INCLUDES) - include_directories(${EXTRA_INCLUDES}) + include_directories(${EXTRA_INCLUDES}) endif(EXTRA_INCLUDES) if (EXTRA_LIBDIR) - link_directories(${EXTRA_LIBDIR}) + link_directories(${EXTRA_LIBDIR}) endif(EXTRA_LIBDIR) ### Detect environment @@ -128,17 +128,17 @@ set(CPACK_PACKAGE_EXECUTABLES "navit;Navit") set(CPACK_NSIS_HELP_LINK "http://www.navit-project.org/?page=contact") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.navit-project.org") if(WIN32) - add_feature(USE_NSIS "makensis not found" FALSE) - FIND_PROGRAM(NSIS_EXECUTABLE NAMES makensis makensis.exe) - if(NSIS_EXECUTABLE) - set_with_reason(USE_NSIS "makensis found" TRUE) - endif(NSIS_EXECUTABLE) - - set(CPACK_GENERATOR ZIP) - if(USE_NSIS) - list(APPEND CPACK_GENERATOR NSIS) - endif(USE_NSIS) - set(CPACK_PACKAGE_INSTALL_DIRECTORY Navit) + add_feature(USE_NSIS "makensis not found" FALSE) + FIND_PROGRAM(NSIS_EXECUTABLE NAMES makensis makensis.exe) + if(NSIS_EXECUTABLE) + set_with_reason(USE_NSIS "makensis found" TRUE) + endif(NSIS_EXECUTABLE) + + set(CPACK_GENERATOR ZIP) + if(USE_NSIS) + list(APPEND CPACK_GENERATOR NSIS) + endif(USE_NSIS) + set(CPACK_PACKAGE_INSTALL_DIRECTORY Navit) endif(WIN32) INCLUDE (CPack) @@ -167,44 +167,44 @@ find_package(Threads) libfind_pkg_check_modules(FONTCONFIG fontconfig) #Qt detection if (NOT DISABLE_QT) - find_package(Qt5Widgets) - find_package(Qt5Quick) - find_package(Qt5Positioning) - if (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) - add_feature (USE_QWIDGET "Qt5 Qt5Widget not found" FALSE) - add_feature (USE_QML "Qt5 Qt5Quick not found" FALSE) - if (Qt5Widgets_FOUND OR Qt5Quick_FOUND) - find_package(Qt5Svg REQUIRED) - find_package(Qt5DBus REQUIRED) - find_package(Qt5Multimedia) - find_package(espeak) - endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND) - if (Qt5Positioning_FOUND) - find_package(Qt5Sensors REQUIRED) - endif (Qt5Positioning_FOUND) - else (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) - # Unfortunately, CMake seems to ignore the "OPTIONAL_COMPONENTS" flag, - # and actually requires all components to be installed. Maybe this can - # be fixed later... - find_package(Qt4 4.7 COMPONENTS QtCore OPTIONAL_COMPONENTS QtGui QtXml QtDeclarative QtSvg) - endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) + find_package(Qt5Widgets) + find_package(Qt5Quick) + find_package(Qt5Positioning) + if (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) + add_feature (USE_QWIDGET "Qt5 Qt5Widget not found" FALSE) + add_feature (USE_QML "Qt5 Qt5Quick not found" FALSE) + if (Qt5Widgets_FOUND OR Qt5Quick_FOUND) + find_package(Qt5Svg REQUIRED) + find_package(Qt5DBus REQUIRED) + find_package(Qt5Multimedia) + find_package(espeak) + endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND) + if (Qt5Positioning_FOUND) + find_package(Qt5Sensors REQUIRED) + endif (Qt5Positioning_FOUND) + else (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND) + # Unfortunately, CMake seems to ignore the "OPTIONAL_COMPONENTS" flag, + # and actually requires all components to be installed. Maybe this can + # be fixed later... + find_package(Qt4 4.7 COMPONENTS QtCore OPTIONAL_COMPONENTS QtGui QtXml QtDeclarative QtSvg) + 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=3.1) - pkg_check_modules(LIBGARMIN libgarmin) - pkg_check_modules(IMLIB2 imlib2) - if(IMLIB2_FOUND) - set(HAVE_IMLIB2 1) - endif(IMLIB2_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=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) @@ -217,10 +217,10 @@ CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET) CHECK_INCLUDE_FILES(sys/shm.h HAVE_SHMEM) CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) if (NOT HAVE_SNPRINTF) - CHECK_FUNCTION_EXISTS(_snprintf HAVE_DECL__SNPRINTF) - if (HAVE_DECL__SNPRINTF) - set(HAVE_SNPRINTF 1) - endif(HAVE_DECL__SNPRINTF) + CHECK_FUNCTION_EXISTS(_snprintf HAVE_DECL__SNPRINTF) + if (HAVE_DECL__SNPRINTF) + set(HAVE_SNPRINTF 1) + endif(HAVE_DECL__SNPRINTF) endif(NOT HAVE_SNPRINTF) CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES) CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL) @@ -240,237 +240,237 @@ CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC) ### Configure build #Required libraries, supplied with navit if (NOT HAVE_LIBINTL) - set_with_reason(support/gettext_intl "native libintl missing" TRUE) - set(USE_LIBGNUINTL TRUE) + set_with_reason(support/gettext_intl "native libintl missing" TRUE) + set(USE_LIBGNUINTL TRUE) else() - CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL) - if (NEEDS_LIBINTL) - list(APPEND NAVIT_LIBS intl) - set(INTL_LIBS intl) - endif(NEEDS_LIBINTL) + CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL) + if (NEEDS_LIBINTL) + list(APPEND NAVIT_LIBS intl) + set(INTL_LIBS intl) + endif(NEEDS_LIBINTL) endif(NOT HAVE_LIBINTL) if (CMAKE_USE_PTHREADS_INIT) - if (NOT ANDROID) - list(APPEND NAVIT_LIBS pthread) - endif(NOT ANDROID) + if (NOT ANDROID) + 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}) + 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}) + 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}) + 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}) - list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES}) + set(HAVE_ZLIB 1) + include_directories(${ZLIB_INCLUDE_DIRS}) + list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES}) else(ZLIB_FOUND) - message(STATUS "using internal zlib") - set_with_reason(support/zlib "native zlib missing" TRUE) + message(STATUS "using internal zlib") + set_with_reason(support/zlib "native zlib missing" TRUE) endif(ZLIB_FOUND) if(PNG_FOUND) - set(HAVE_PNG 1) - include_directories(${PNG_INCLUDE_DIR}) - list(APPEND NAVIT_LIBS ${PNG_LIBRARIES}) + set(HAVE_PNG 1) + include_directories(${PNG_INCLUDE_DIR}) + list(APPEND NAVIT_LIBS ${PNG_LIBRARIES}) else(PNG_FOUND) - message(STATUS "using internal libpng") - set_with_reason(support/libpng "native libpng missing" TRUE) + message(STATUS "using internal libpng") + set_with_reason(support/libpng "native libpng missing" TRUE) endif(PNG_FOUND) if (NOT HAVE_WORDEXP) - message(STATUS "wordexp.h not found. use internal wordexp") - set_with_reason(support/wordexp "native wordexp missing" TRUE) + message(STATUS "wordexp.h not found. use internal wordexp") + set_with_reason(support/wordexp "native wordexp missing" TRUE) endif() if (NOT Glib_FOUND) - set_with_reason(support/ezxml "Glib not found" TRUE) + set_with_reason(support/ezxml "Glib not found" TRUE) endif() if(FREETYPE_FOUND) - pkg_check_modules(FRIBIDI fribidi) - pkg_check_modules(FRIBIDI2 fribidi>=0.19.0) - include_directories(${FREETYPE_INCLUDE_DIRS}) - set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LDFLAGS};${FRIBIDI_LIBRARIES}") + pkg_check_modules(FRIBIDI fribidi) + pkg_check_modules(FRIBIDI2 fribidi>=0.19.0) + include_directories(${FREETYPE_INCLUDE_DIRS}) + set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LDFLAGS};${FRIBIDI_LIBRARIES}") else(FREETYPE_FOUND) - MESSAGE("No freetype library found, graphics modules may not be available") - set_with_reason(graphics/android "FreeType library not found" FALSE) - set_with_reason(graphics/gd "FreeType library not found" FALSE) - set_with_reason(graphics/gtk_drawing_area "FreeType library not found" FALSE) - set_with_reason(graphics/opengl "FreeType library not found" FALSE) - set_with_reason(graphics/sdl "FreeType library not found" FALSE) - set_with_reason(graphics/egl "FreeType library not found" FALSE) + MESSAGE("No freetype library found, graphics modules may not be available") + set_with_reason(graphics/android "FreeType library not found" FALSE) + set_with_reason(graphics/gd "FreeType library not found" FALSE) + set_with_reason(graphics/gtk_drawing_area "FreeType library not found" FALSE) + set_with_reason(graphics/opengl "FreeType library not found" FALSE) + set_with_reason(graphics/sdl "FreeType library not found" FALSE) + set_with_reason(graphics/egl "FreeType library not found" FALSE) endif(FREETYPE_FOUND) if(FONTCONFIG_FOUND) - set(HAVE_FONTCONFIG 1) + set(HAVE_FONTCONFIG 1) endif(FONTCONFIG_FOUND) if (QT_FOUND) - if (QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND FREETYPE_FOUND) - include(${QT_USE_FILE}) - set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE ${QT_LIBRARIES}) - - if (QT_QTDECLARATIVE_FOUND AND QT_QTXML_FOUND) - set_with_reason(gui/qml "Qt Declarative found" TRUE ${QT_LIBRARIES}) - endif() - - if (QT_QTSVG_FOUND) - set(HAVE_QT_SVG 1) - elseif( USE_SVG AND graphics/qt_qpainter) - message( WARNING "QT compiled without SVG support") - endif() - endif() + if (QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND FREETYPE_FOUND) + include(${QT_USE_FILE}) + set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE ${QT_LIBRARIES}) + + if (QT_QTDECLARATIVE_FOUND AND QT_QTXML_FOUND) + set_with_reason(gui/qml "Qt Declarative found" TRUE ${QT_LIBRARIES}) + endif() + + if (QT_QTSVG_FOUND) + set(HAVE_QT_SVG 1) + elseif( USE_SVG AND graphics/qt_qpainter) + message( WARNING "QT compiled without SVG support") + endif() + endif() endif(QT_FOUND) if (Qt5Widgets_FOUND OR Qt5Quick_FOUND) - set(Qt5_ADDITIONAL_LIBRARIES "") - if(Qt5Widgets_FOUND) - set_with_reason(USE_QWIDGET "Qt5Widgets found" TRUE) - if(USE_QWIDGET) - set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Widgets_LIBRARIES}) - endif() - endif() - if(Qt5Quick_FOUND) - set_with_reason(USE_QML "Qt5Quick found" TRUE) - if(USE_QML) - set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Quick_LIBRARIES}) - endif() - set_with_reason(gui/qt5_qml "Qt5 found" TRUE - ${Qt5Quick_LIBRARIES}) - - endif() - set_with_reason(graphics/qt5 "Qt5 found" TRUE + set(Qt5_ADDITIONAL_LIBRARIES "") + if(Qt5Widgets_FOUND) + set_with_reason(USE_QWIDGET "Qt5Widgets found" TRUE) + if(USE_QWIDGET) + set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + endif() + endif() + if(Qt5Quick_FOUND) + set_with_reason(USE_QML "Qt5Quick found" TRUE) + if(USE_QML) + set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Quick_LIBRARIES}) + endif() + set_with_reason(gui/qt5_qml "Qt5 found" TRUE + ${Qt5Quick_LIBRARIES}) + + endif() + set_with_reason(graphics/qt5 "Qt5 found" TRUE ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5DBus_LIBRARIES}) - if (Qt5Multimedia_FOUND) - if (espeak_FOUND) - set_with_reason(support/espeak "native espeak found" FALSE) - set_with_reason(speech/qt5_espeak "Qt5Multimedia and libespeak found" TRUE - ${Qt5Multimedia_LIBRARIES} - ${espeak_LIBRARIES}) - else() - set_with_reason(support/espeak "native espeak missing" TRUE) - set_with_reason(INTERNAL_ESPEAK_COMPLETE "speech_qt5_espeak requires full libespeak" TRUE) - set_with_reason(speech/qt5_espeak "Qt5Multimedia found" TRUE - ${Qt5Multimedia_LIBRARIES}) - endif() - endif() + if (Qt5Multimedia_FOUND) + if (espeak_FOUND) + set_with_reason(support/espeak "native espeak found" FALSE) + set_with_reason(speech/qt5_espeak "Qt5Multimedia and libespeak found" TRUE + ${Qt5Multimedia_LIBRARIES} + ${espeak_LIBRARIES}) + else() + set_with_reason(support/espeak "native espeak missing" TRUE) + set_with_reason(INTERNAL_ESPEAK_COMPLETE "speech_qt5_espeak requires full libespeak" TRUE) + set_with_reason(speech/qt5_espeak "Qt5Multimedia found" TRUE + ${Qt5Multimedia_LIBRARIES}) + endif() + endif() endif () if (Qt5Positioning_FOUND) - set_with_reason(vehicle/qt5 "Qt5 Positioning found" TRUE + set_with_reason(vehicle/qt5 "Qt5 Positioning found" TRUE ${Qt5Positioning_LIBRARIES} ${Qt5Sensors_LIBRARIES}) endif () if(GTK2_FOUND) - # Include gtk.h with "SYSTEM" to avoid GCC compiler warning for gtkitemfactory.h. - include_directories(SYSTEM ${GTK2_GTK_INCLUDE_DIR}) - include_directories(${GTK2_INCLUDE_DIRS}) - set(HAVE_GTK2 1) - set_with_reason(gui/gtk "GTK libs found" TRUE ${GTK2_LIBRARIES}) - if(FREETYPE_FOUND) - set_with_reason(graphics/gtk_drawing_area "GTK libs found" TRUE ${GTK2_LIBRARIES}) - endif(FREETYPE_FOUND) + # Include gtk.h with "SYSTEM" to avoid GCC compiler warning for gtkitemfactory.h. + include_directories(SYSTEM ${GTK2_GTK_INCLUDE_DIR}) + include_directories(${GTK2_INCLUDE_DIRS}) + set(HAVE_GTK2 1) + set_with_reason(gui/gtk "GTK libs found" TRUE ${GTK2_LIBRARIES}) + if(FREETYPE_FOUND) + set_with_reason(graphics/gtk_drawing_area "GTK libs found" TRUE ${GTK2_LIBRARIES}) + endif(FREETYPE_FOUND) endif(GTK2_FOUND) CHECK_LIBRARY_EXISTS(freeimage FreeImage_Load "" HAVE_FREEIMAGE) if (USE_OPENGLES OR USE_OPENGLES2) - CHECK_LIBRARY_EXISTS(EGL eglInitialize "" HAVE_EGL) + CHECK_LIBRARY_EXISTS(EGL eglInitialize "" HAVE_EGL) endif(USE_OPENGLES OR USE_OPENGLES2) if (FREETYPE_FOUND) - if (OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND AND OPENGL_INCLUDE_DIR) - message (STATUS "opengl found: ${OPENGL_gl_LIBRARY}") - include_directories(${OPENGL_INCLUDE_DIR}) - if (USE_OPENGLES2) - set(USE_OPENGLES TRUE) - set(GRAPHICS_OPENGL_LIBRARY GLESv2 EGL) - elseif (USE_OPENGLES) - set(GRAPHICS_OPENGL_LIBRARY GLESv1_CM EGL) - else() - set(GRAPHICS_OPENGL_LIBRARY ${OPENGL_gl_LIBRARY};${OPENGL_glu_LIBRARY};${GLUT_glut_LIBRARY}) - endif(USE_OPENGLES2) - if (HAVE_FREEIMAGE) - list(APPEND GRAPHICS_OPENGL_LIBRARY freeimage) - endif(HAVE_FREEIMAGE) - set_with_reason(graphics/opengl "Found OpenGL" TRUE ${GRAPHICS_OPENGL_LIBRARY}) - else() - message (STATUS "opengl not found") - endif() + if (OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND AND OPENGL_INCLUDE_DIR) + message (STATUS "opengl found: ${OPENGL_gl_LIBRARY}") + include_directories(${OPENGL_INCLUDE_DIR}) + if (USE_OPENGLES2) + set(USE_OPENGLES TRUE) + set(GRAPHICS_OPENGL_LIBRARY GLESv2 EGL) + elseif (USE_OPENGLES) + set(GRAPHICS_OPENGL_LIBRARY GLESv1_CM EGL) + else() + set(GRAPHICS_OPENGL_LIBRARY ${OPENGL_gl_LIBRARY};${OPENGL_glu_LIBRARY};${GLUT_glut_LIBRARY}) + endif(USE_OPENGLES2) + if (HAVE_FREEIMAGE) + list(APPEND GRAPHICS_OPENGL_LIBRARY freeimage) + endif(HAVE_FREEIMAGE) + set_with_reason(graphics/opengl "Found OpenGL" TRUE ${GRAPHICS_OPENGL_LIBRARY}) + else() + message (STATUS "opengl not found") + endif() else() - message (STATUS "no Freetype found") + message (STATUS "no Freetype found") endif(FREETYPE_FOUND) if(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND) - set(SDL_IMAGE 1) - if(SDLTTF_FOUND) - set(SDL_TTF 1) - list(APPEND SDL_LIBRARY ${SDLTTF_LIBRARY}) - else(SDLTTF_FOUND) - list(APPEND SDL_LIBRARY ${FREETYPE_LIBRARY}) - endif(SDLTTF_FOUND) - set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY}) + set(SDL_IMAGE 1) + if(SDLTTF_FOUND) + set(SDL_TTF 1) + list(APPEND SDL_LIBRARY ${SDLTTF_LIBRARY}) + else(SDLTTF_FOUND) + list(APPEND SDL_LIBRARY ${FREETYPE_LIBRARY}) + endif(SDLTTF_FOUND) + set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY}) endif(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND) if(SDL2MAIN AND SDL2IMAGE AND GLES2) - set_with_reason(graphics/egl "SDL2/SDL2_image libs found" TRUE ${SDL2MAIN} ${SDL2IMAGE} ${GLES2}) - message(STATUS "EGL libs found : ${SDL2MAIN} ${SDL2IMAGE} ${GLES2}") + set_with_reason(graphics/egl "SDL2/SDL2_image libs found" TRUE ${SDL2MAIN} ${SDL2IMAGE} ${GLES2}) + message(STATUS "EGL libs found : ${SDL2MAIN} ${SDL2IMAGE} ${GLES2}") endif(SDL2MAIN AND SDL2IMAGE AND GLES2) if (LIBGPS_FOUND) - if (LIBGPS_NEW_FOUND) - set(VEHICLE_GPSD_REASON "gpsd lib found") - else(LIBGPS_NEW_FOUND) - set(VEHICLE_GPSD_REASON "WARNING: old gpsd lib found, buggy if LC_ALL is set") - endif(LIBGPS_NEW_FOUND) - set_with_reason(vehicle/gpsd ${VEHICLE_GPSD_REASON} TRUE ${LIBGPS_LDFLAGS}) + if (LIBGPS_NEW_FOUND) + set(VEHICLE_GPSD_REASON "gpsd lib found") + else(LIBGPS_NEW_FOUND) + set(VEHICLE_GPSD_REASON "WARNING: old gpsd lib found, buggy if LC_ALL is set") + endif(LIBGPS_NEW_FOUND) + set_with_reason(vehicle/gpsd ${VEHICLE_GPSD_REASON} TRUE ${LIBGPS_LDFLAGS}) endif(LIBGPS_FOUND) if (GYPSY_FOUND) - set_with_reason(vehicle/gypsy "gypsy lib found" TRUE) + set_with_reason(vehicle/gypsy "gypsy lib found" TRUE) endif(GYPSY_FOUND) if (LIBGARMIN_FOUND) - include_directories(${LIBGARMIN_INCLUDE_DIRS}) - set_with_reason(map/garmin "Garmin library found" TRUE ${LIBGARMIN_LDFLAGS}) + include_directories(${LIBGARMIN_INCLUDE_DIRS}) + 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}) + 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}) + set_with_reason(binding/python "python libraries [${PYTHONLIBS_VERSION_STRING}] found" TRUE ${PYTHON_LIBRARIES}) endif() if (HAVE_LIBSPEECHD) - set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE speechd) + set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE speechd) endif(HAVE_LIBSPEECHD) if (HAVE_SYSTEM) - set_with_reason(speech/cmdline "system() call is available" TRUE) + set_with_reason(speech/cmdline "system() call is available" TRUE) endif(HAVE_SYSTEM) if (HAVE_CREATEPROCESS) - set_with_reason(speech/cmdline "CreateProcess() call is available" TRUE) + set_with_reason(speech/cmdline "CreateProcess() call is available" TRUE) endif(HAVE_CREATEPROCESS) if (LIBLOCATION_FOUND) - set_with_reason(vehicle/maemo "Maemo location library found" TRUE ${LIBLOCATION_LIBRARIES}) + set_with_reason(vehicle/maemo "Maemo location library found" TRUE ${LIBLOCATION_LIBRARIES}) endif(LIBLOCATION_FOUND) if (LIBOSSO_FOUND) - set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES}) + set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES}) endif(LIBOSSO_FOUND) if (GETTEXT_FOUND) - set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE) + set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE) endif(GETTEXT_FOUND) #Independent modules @@ -483,7 +483,7 @@ add_module(gui/internal "Default" TRUE) add_module(map/binfile "Default" TRUE) add_module(map/filter "Default" TRUE) if(NOT MSVC) -add_module(map/mg "Default" TRUE) + add_module(map/mg "Default" TRUE) endif(NOT MSVC) add_module_plugin(support/shapefile "Default" TRUE) set(map_shapefile_INCLUDES "${CMAKE_SOURCE_DIR}/navit/support/shapefile") @@ -513,25 +513,25 @@ add_feature(SAMPLE_MAP "default" TRUE) add_feature(NETWORK_INFO "default" FALSE) IF(NOT svg2png_scaling) - IF(NOT ANDROID) - set(svg2png_scaling 0 16 32 48 64 96) - ELSE() - set(svg2png_scaling -1 24 32 48 64 96 128) - ENDIF() + IF(NOT ANDROID) + set(svg2png_scaling 0 16 32 48 64 96) + ELSE() + set(svg2png_scaling -1 24 32 48 64 96 128) + ENDIF() ENDIF() IF(NOT svg2png_scaling_flag) - IF(NOT ANDROID) - set(svg2png_scaling_flag 32) - ELSE() - set(svg2png_scaling_flag -1 24 32 64 96) - ENDIF() + IF(NOT ANDROID) + set(svg2png_scaling_flag 32) + ELSE() + set(svg2png_scaling_flag -1 24 32 64 96) + ENDIF() ENDIF() IF(NOT svg2png_scaling_nav) - IF(NOT ANDROID) - set(svg2png_scaling_nav 64) - ELSE() - set(svg2png_scaling_nav -1 24 32 48 64 96 128) - ENDIF() + IF(NOT ANDROID) + set(svg2png_scaling_nav 64) + ELSE() + set(svg2png_scaling_nav -1 24 32 48 64 96 128) + ENDIF() ENDIF() add_feature(DBUS_USE_SYSTEM_BUS "default" FALSE) @@ -541,234 +541,234 @@ add_feature(XSL_PROCESSING "default" TRUE) set(SUPPORTED_XSLT_PROCESSORS "saxonb-xslt;saxon;saxon8;saxon-xslt;xsltproc;transform.exe") find_program(XSLT_PROCESSOR NAMES ${SUPPORTED_XSLT_PROCESSORS}) if(XSLT_PROCESSOR) - message(STATUS "Found XSLT processor: ${XSLT_PROCESSOR}") - execute_process(COMMAND ${XSLT_PROCESSOR} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt - RESULT_VARIABLE SAXON_ERROR OUTPUT_QUIET ERROR_QUIET) - if (NOT SAXON_ERROR) - set (XSLT_PROCESSOR_OPTIONS -snone) - endif() - # additional parameter is passed to the stylesheet processor as transformation parameter - macro(compose_xslt_transform_command CMDVAR XSLT_FILE SRC_XML DEST_XML) - if(${XSLT_PROCESSOR} MATCHES "xsltproc") - set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${XSLT_FILE} ${SRC_XML} >${DEST_XML}) - else() - set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${SRC_XML} ${XSLT_FILE} ${ARGN} >${DEST_XML}) - endif() - endmacro() + message(STATUS "Found XSLT processor: ${XSLT_PROCESSOR}") + execute_process(COMMAND ${XSLT_PROCESSOR} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt + RESULT_VARIABLE SAXON_ERROR OUTPUT_QUIET ERROR_QUIET) + if (NOT SAXON_ERROR) + set (XSLT_PROCESSOR_OPTIONS -snone) + endif() + # additional parameter is passed to the stylesheet processor as transformation parameter + macro(compose_xslt_transform_command CMDVAR XSLT_FILE SRC_XML DEST_XML) + if(${XSLT_PROCESSOR} MATCHES "xsltproc") + set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${XSLT_FILE} ${SRC_XML} >${DEST_XML}) + else() + set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${SRC_XML} ${XSLT_FILE} ${ARGN} >${DEST_XML}) + endif() + endmacro() else() - cfg_feature(XSL_PROCESSING "Saxon missing" FALSE) + cfg_feature(XSL_PROCESSING "Saxon missing" FALSE) endif(XSLT_PROCESSOR) if (NOT XSL_PROCESSING) - message(WARNING "No XSLT processor available. You have to configure " -"navit.xml yourself, or install an XSLT processor (supported: " -"${SUPPORTED_XSLT_PROCESSORS}).") + message(WARNING "No XSLT processor available. You have to configure " + "navit.xml yourself, or install an XSLT processor (supported: " + "${SUPPORTED_XSLT_PROCESSORS}).") endif() ### Platform specific settings if(NOT CACHE_SIZE) - SET(CACHE_SIZE 1048576) + SET(CACHE_SIZE 1048576) endif(NOT CACHE_SIZE) if(WIN32 OR WINCE) - SET(CMAKE_EXECUTABLE_SUFFIX ".exe") - add_module(graphics/win32 "Windows detected" TRUE) - add_plugin(support/win32 "Windows detected" TRUE) - - SET(CMAKE_RC_COMPILE_OBJECT " -O coff -I ${CMAKE_CURRENT_SOURCE_DIR}/navit/gui/win32/resources -i -o ") - set_with_reason(support/ezxml "Windows detected" TRUE) - set_with_reason(speech/espeak "Windows detected" TRUE) - #speech/espeak does use windows threads, and therefore needs only parts of - #espeak lib. INTERNAL_ESPEAK_COMPLETE controls this. - set_with_reason(INTERNAL_ESPEAK_COMPLETE "Windows detected" FALSE) - set_with_reason(support/espeak "Windows detected" TRUE) - set_with_reason(binding/win32 "Windows detected" TRUE) - - # vehicle_file is broken for windows. use vehicle_wince instead - # whicle_wince isn't buildable on non-CE windows ssytems - - # plugins currently not supported on windows - set_with_reason(USE_PLUGINS "win32: currently not supported" FALSE) - - set(HAVE_API_WIN32_BASE 1) - set(EZXML_NOMMAP 1) - - # Image stuff - if(NOT graphics/qt_qpainter) - set_with_reason(USE_SVG "win32: SVGs currently not supported" FALSE) - else(NOT graphics/qt_qpainter) - MESSAGE(STATUS "win32: SVGs may not be supported by every available graphics") - endif(NOT graphics/qt_qpainter) - - set(BIN_DIR bin) - set(SHARE_DIR ./) - set(LOCALE_DIR locale) - set(IMAGE_DIR icons) - - - if(HAVE_GTK2 AND NOT MSVC) - #GTK requires special compile flags - add_definitions("-mms-bitfields") - endif(HAVE_GTK2 AND NOT MSVC) - if(MSVC AND support/espeak) - add_definitions(-DPLATFORM_WINDOWS) - endif(MSVC AND support/espeak) - CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK) - if(HAVE_WINSOCK) - list(APPEND NAVIT_LIBS ws2_32) - else() - CHECK_LIBRARY_EXISTS(ws2 WSAStartup "" HAVE_WINSOCK_2) - if(HAVE_WINSOCK_2) - set(HAVE_WINSOCK 1) - list(APPEND NAVIT_LIBS ws2) - endif() - endif(HAVE_WINSOCK) - - if(MSVC) - set(HAVE_PRAGMA_PACK 1) - add_plugin(support/xgetopt "Windows detected" TRUE) - endif(MSVC) - set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Windows detected" TRUE) - enable_language(RC) - - set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") + SET(CMAKE_EXECUTABLE_SUFFIX ".exe") + add_module(graphics/win32 "Windows detected" TRUE) + add_plugin(support/win32 "Windows detected" TRUE) + + SET(CMAKE_RC_COMPILE_OBJECT " -O coff -I ${CMAKE_CURRENT_SOURCE_DIR}/navit/gui/win32/resources -i -o ") + set_with_reason(support/ezxml "Windows detected" TRUE) + set_with_reason(speech/espeak "Windows detected" TRUE) + #speech/espeak does use windows threads, and therefore needs only parts of + #espeak lib. INTERNAL_ESPEAK_COMPLETE controls this. + set_with_reason(INTERNAL_ESPEAK_COMPLETE "Windows detected" FALSE) + set_with_reason(support/espeak "Windows detected" TRUE) + set_with_reason(binding/win32 "Windows detected" TRUE) + + # vehicle_file is broken for windows. use vehicle_wince instead + # whicle_wince isn't buildable on non-CE windows ssytems + + # plugins currently not supported on windows + set_with_reason(USE_PLUGINS "win32: currently not supported" FALSE) + + set(HAVE_API_WIN32_BASE 1) + set(EZXML_NOMMAP 1) + + # Image stuff + if(NOT graphics/qt_qpainter) + set_with_reason(USE_SVG "win32: SVGs currently not supported" FALSE) + else(NOT graphics/qt_qpainter) + MESSAGE(STATUS "win32: SVGs may not be supported by every available graphics") + endif(NOT graphics/qt_qpainter) + + set(BIN_DIR bin) + set(SHARE_DIR ./) + set(LOCALE_DIR locale) + set(IMAGE_DIR icons) + + + if(HAVE_GTK2 AND NOT MSVC) + #GTK requires special compile flags + add_definitions("-mms-bitfields") + endif(HAVE_GTK2 AND NOT MSVC) + if(MSVC AND support/espeak) + add_definitions(-DPLATFORM_WINDOWS) + endif(MSVC AND support/espeak) + CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK) + if(HAVE_WINSOCK) + list(APPEND NAVIT_LIBS ws2_32) + else() + CHECK_LIBRARY_EXISTS(ws2 WSAStartup "" HAVE_WINSOCK_2) + if(HAVE_WINSOCK_2) + set(HAVE_WINSOCK 1) + list(APPEND NAVIT_LIBS ws2) + endif() + endif(HAVE_WINSOCK) + + if(MSVC) + set(HAVE_PRAGMA_PACK 1) + add_plugin(support/xgetopt "Windows detected" TRUE) + endif(MSVC) + set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Windows detected" TRUE) + enable_language(RC) + + set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") endif() if (WIN32 AND NOT WINCE) - set(HAVE_API_WIN32 1) - set(HAVE_STDINT_H 1) - list(APPEND NAVIT_LIBS winmm) + set(HAVE_API_WIN32 1) + set(HAVE_STDINT_H 1) + list(APPEND NAVIT_LIBS winmm) endif() if(WINCE) - add_plugin(support/libc "wince detected" TRUE) - set(HAVE_API_WIN32_CE 1) - set(BUILD_MAPTOOL FALSE) - # mingw32ce since gcc 4.7.0 needs HAVE_PRAGMA_PACK as __attribute__((packed)) is broken, see gcc bug 52991 - set(HAVE_PRAGMA_PACK 1) - set_with_reason(vehicle/file "wince: currently broken" FALSE) - set_with_reason(vehicle/wince "wince detected" TRUE) + add_plugin(support/libc "wince detected" TRUE) + set(HAVE_API_WIN32_CE 1) + set(BUILD_MAPTOOL FALSE) + # mingw32ce since gcc 4.7.0 needs HAVE_PRAGMA_PACK as __attribute__((packed)) is broken, see gcc bug 52991 + set(HAVE_PRAGMA_PACK 1) + set_with_reason(vehicle/file "wince: currently broken" FALSE) + set_with_reason(vehicle/wince "wince detected" TRUE) endif() if (APPLE OR USE_UIKIT) - set_with_reason(vehicle/iphone "apple detected" TRUE) - set_with_reason(graphics/cocoa "apple detected" TRUE) - if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/VoiceServices.framework") - set_with_reason(speech/iphone "apple detected" TRUE) - endif() - set(BUILD_BUNDLE TRUE CACHE BOOLEAN "build an osx bundle") + set_with_reason(vehicle/iphone "apple detected" TRUE) + set_with_reason(graphics/cocoa "apple detected" TRUE) + if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/VoiceServices.framework") + set_with_reason(speech/iphone "apple detected" TRUE) + endif() + set(BUILD_BUNDLE TRUE CACHE BOOLEAN "build an osx bundle") endif() if(CMAKE_SIZEOF_VOID_P LESS 8) - set_with_reason(BUILD_MAPTOOL "maptool works only on 64 bit architectures" FALSE) + set_with_reason(BUILD_MAPTOOL "maptool works only on 64 bit architectures" FALSE) endif() set(LOCALEDIR "${LOCALE_DIR}") find_program(BZCAT NAMES bzcat) if (SAMPLE_MAP) - if(CMAKE_CROSSCOMPILING) - cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE) - set(DOWNLOAD_SAMPLE_MAP TRUE) - elseif(NOT BZCAT) - cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE) - set(DOWNLOAD_SAMPLE_MAP TRUE) - elseif(NOT BUILD_MAPTOOL) - cfg_feature(SAMPLE_MAP "downloading binary map because maptool compilation is disabled" TRUE) - set(DOWNLOAD_SAMPLE_MAP TRUE) - endif(CMAKE_CROSSCOMPILING) + if(CMAKE_CROSSCOMPILING) + cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE) + set(DOWNLOAD_SAMPLE_MAP TRUE) + elseif(NOT BZCAT) + cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE) + set(DOWNLOAD_SAMPLE_MAP TRUE) + elseif(NOT BUILD_MAPTOOL) + cfg_feature(SAMPLE_MAP "downloading binary map because maptool compilation is disabled" TRUE) + set(DOWNLOAD_SAMPLE_MAP TRUE) + endif(CMAKE_CROSSCOMPILING) endif(SAMPLE_MAP) check_symbol_exists (getifaddrs "sys/types.h;ifaddrs.h" HAS_IFADDRS) if (HAS_IFADDRS) - cfg_feature(NETWORK_INFO "ifaddrs.h found" TRUE) + cfg_feature(NETWORK_INFO "ifaddrs.h found" TRUE) endif(HAS_IFADDRS) if(ANDROID) - message(STATUS "Using generator "${CMAKE_GENERATOR}) - if (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) - find_program(ANDROID_LOCATION NAMES android android.bat) - find_program(ANT_LOCATION NAMES ant) - if (NOT ANT_LOCATION) - message_error("Could not find ant. Please install ant and add it to the search path.") - else() - execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET) - if(ANT_VERSION_OK GREATER 0) - message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8") - endif() - endif() - if (NOT ANDROID_LOCATION) - message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the /tools directory to the search path.") - endif() - set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") - endif (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) - list(APPEND NAVIT_LIBS log) - set(HAVE_API_ANDROID 1) - set_with_reason(speech/cmdline "Android detected" FALSE) - set_with_reason(graphics/null "Android detected" FALSE) - set_with_reason(graphics/android "Android detected" TRUE) - set_with_reason(speech/android "Android detected" TRUE) - set_with_reason(vehicle/android "Android detected" TRUE) - set_with_reason(vehicle/file "Android detected" FALSE) - set_with_reason(map/filter "Android detected" FALSE) - set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Android detected" TRUE) -# set_with_reason(plugin/pedestrian "Android detected" TRUE) - set_with_reason(support/libpng "Android detected" FALSE) - set(SHARED_LIBNAVIT TRUE) - - add_feature(XPM2PNG "Android detected" TRUE) - set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -fPIC") + message(STATUS "Using generator "${CMAKE_GENERATOR}) + if (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) + find_program(ANDROID_LOCATION NAMES android android.bat) + find_program(ANT_LOCATION NAMES ant) + if (NOT ANT_LOCATION) + message_error("Could not find ant. Please install ant and add it to the search path.") + else() + execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET) + if(ANT_VERSION_OK GREATER 0) + message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8") + endif() + endif() + if (NOT ANDROID_LOCATION) + message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the /tools directory to the search path.") + endif() + set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") + endif (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) + list(APPEND NAVIT_LIBS log) + set(HAVE_API_ANDROID 1) + set_with_reason(speech/cmdline "Android detected" FALSE) + set_with_reason(graphics/null "Android detected" FALSE) + set_with_reason(graphics/android "Android detected" TRUE) + set_with_reason(speech/android "Android detected" TRUE) + set_with_reason(vehicle/android "Android detected" TRUE) + set_with_reason(vehicle/file "Android detected" FALSE) + set_with_reason(map/filter "Android detected" FALSE) + set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Android detected" TRUE) + # set_with_reason(plugin/pedestrian "Android detected" TRUE) + set_with_reason(support/libpng "Android detected" FALSE) + set(SHARED_LIBNAVIT TRUE) + + add_feature(XPM2PNG "Android detected" TRUE) + set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -fPIC") endif(ANDROID) if(FREETYPE_FOUND AND NOT FONTCONFIG_FOUND) - add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/navit/fonts") + add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/navit/fonts") endif() # Image conversion find_program(IMAGE_CONVERTER NAMES convert) execute_process(COMMAND ${IMAGE_CONVERTER} -list format OUTPUT_VARIABLE CONVERT_FORMATS) if(CONVERT_FORMATS MATCHES ".*XPM[ *][ ]*XPM[ ]*r[w-].*") - set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER}) + set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER}) endif() set(CMAKE_APPBUNDLE_PATH "") if (SVG2PNG) - if (NOT IMAGE_CONVERTER_SVGZ) - set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4 inkscape) - set (CMAKE_FIND_APPBUNDLE "NEVER") - find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin) - if (NOT IMAGE_CONVERTER_SVGZ) - if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*") - set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER}) - endif() - endif() - endif(NOT IMAGE_CONVERTER_SVGZ) - if (NOT IMAGE_CONVERTER_SVG) - set(IMAGE_CONVERTER_SVG ${IMAGE_CONVERTER_SVGZ}) - endif(NOT IMAGE_CONVERTER_SVG) - - message(STATUS "SVG2PNG-Converter: ${IMAGE_CONVERTER_SVGZ}") - if (NOT IMAGE_CONVERTER_SVGZ) - message(WARNING "No SVG2PNG converter found. Please install one of the following tools: ${SVG_CONVERTER_PROGS}, or imagemagick with svg support") - set_with_reason(SVG2PNG "no converter found" FALSE) - endif(NOT IMAGE_CONVERTER_SVGZ) + if (NOT IMAGE_CONVERTER_SVGZ) + set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4 inkscape) + set (CMAKE_FIND_APPBUNDLE "NEVER") + find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin) + if (NOT IMAGE_CONVERTER_SVGZ) + if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*") + set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER}) + endif() + endif() + endif(NOT IMAGE_CONVERTER_SVGZ) + if (NOT IMAGE_CONVERTER_SVG) + set(IMAGE_CONVERTER_SVG ${IMAGE_CONVERTER_SVGZ}) + endif(NOT IMAGE_CONVERTER_SVG) + + message(STATUS "SVG2PNG-Converter: ${IMAGE_CONVERTER_SVGZ}") + if (NOT IMAGE_CONVERTER_SVGZ) + message(WARNING "No SVG2PNG converter found. Please install one of the following tools: ${SVG_CONVERTER_PROGS}, or imagemagick with svg support") + set_with_reason(SVG2PNG "no converter found" FALSE) + endif(NOT IMAGE_CONVERTER_SVGZ) endif(SVG2PNG) if (XPM2PNG) - message(STATUS "XPM2PNG-Converter: ${IMAGE_CONVERTER_XPM}") - if (NOT IMAGE_CONVERTER_XPM) - message(WARNING "No XPM2PNG converter found. Please install imagemagick with xpm support") - set_with_reason(XPM2PNG "no converter found" FALSE) - endif(NOT IMAGE_CONVERTER_XPM) + message(STATUS "XPM2PNG-Converter: ${IMAGE_CONVERTER_XPM}") + if (NOT IMAGE_CONVERTER_XPM) + message(WARNING "No XPM2PNG converter found. Please install imagemagick with xpm support") + set_with_reason(XPM2PNG "no converter found" FALSE) + endif(NOT IMAGE_CONVERTER_XPM) endif(XPM2PNG) set(XSLTS ${XSLTS} CACHE STRING "define a semicolon seperated list of XSLTs to process") # Plugins if(USE_PLUGINS) - set(MODULE_BUILD_TYPE "MODULE") - add_definitions("-fPIC") - list(APPEND NAVIT_LIBS dl) + set(MODULE_BUILD_TYPE "MODULE") + add_definitions("-fPIC") + list(APPEND NAVIT_LIBS dl) else() - set(MODULE_BUILD_TYPE "STATIC") + set(MODULE_BUILD_TYPE "STATIC") endif(USE_PLUGINS) message(STATUS "Use plugins: ${MODULE_BUILD_TYPE}") @@ -792,15 +792,15 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY # -Wno-sign-compare: We currently just use int almost everywhere. # Unclear if it's really worth correcting. if(CMAKE_COMPILER_IS_GNUCC OR CCMAKE_COMPILER_IS_GNUCXX) - set(COMMON_COMPILER_FLAGS "-Wall -Wundef -Wcast-align -Wpointer-arith -Wno-unused-parameter -Wno-sign-compare") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}") - # flags not available in old GCC versions, or not for both C and C++ - add_compiler_flag_if_available("-Wno-missing-field-initializers") - add_compiler_flag_if_available("-Wextra") - add_compiler_flag_if_available("-Wmissing-prototypes") - add_compiler_flag_if_available("-Wstrict-prototypes") - add_compiler_flag_if_available("-Wformat-security") + set(COMMON_COMPILER_FLAGS "-Wall -Wundef -Wcast-align -Wpointer-arith -Wno-unused-parameter -Wno-sign-compare") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}") + # flags not available in old GCC versions, or not for both C and C++ + add_compiler_flag_if_available("-Wno-missing-field-initializers") + add_compiler_flag_if_available("-Wextra") + add_compiler_flag_if_available("-Wmissing-prototypes") + add_compiler_flag_if_available("-Wstrict-prototypes") + add_compiler_flag_if_available("-Wformat-security") endif() if (EXTRA_DEFINES) @@ -808,54 +808,54 @@ if (EXTRA_DEFINES) endif(EXTRA_DEFINES) if (NOT NAVIT_DEPENDENCY_ERROR) - message("\nSummary:\n") - - set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES}) - list(SORT SUMMARY_COMPONENTS) - - set(LAST_TYPE NONE) - foreach ( SUMMARY_COMP ${SUMMARY_COMPONENTS}) - # split path to type and name - string(REPLACE "/" ";" SUMMARY_COMP_LIST ${SUMMARY_COMP}) - list(GET SUMMARY_COMP_LIST 0 SUMMARY_COMP_TYPE) - list(LENGTH SUMMARY_COMP_LIST SUMMARY_COMP_LIST_LENGTH) - if ( SUMMARY_COMP_LIST_LENGTH GREATER 1 ) - list(GET SUMMARY_COMP_LIST 1 SUMMARY_COMP_NAME) - else() - set(SUMMARY_COMP_NAME ${SUMMARY_COMP}) - endif() - if ( NOT ${LAST_TYPE} STREQUAL ${SUMMARY_COMP_TYPE}) - message("\n--->>> ${SUMMARY_COMP_TYPE}") - set(LAST_TYPE ${SUMMARY_COMP_TYPE}) - endif() - if (${SUMMARY_COMP}) - message("Enabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )") - else() - message("Disabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )") - endif() - endforeach() - - list(SORT ALL_FEATURES) - message("\n--->>> Features") - foreach ( FEATURE ${ALL_FEATURES}) - if ( ${FEATURE} ) - message("Enabled ${FEATURE} ( ${${FEATURE}_REASON} )") - else() - message("Disabled ${FEATURE} ( ${${FEATURE}_REASON} )") - endif() - endforeach() - - if (XSL_PROCESSING) - if (XSLTS) - message("\nProcessing XSLT files: ${XSLTS}") - else() - message("\nProcessing XSLT files: NONE") - endif(XSLTS) - message("See navit/xslt for available XSLT files, and put them into " - "cache variable 'XSLTS' (without extension .xslt).") - endif(XSL_PROCESSING) - - message("\nTo configure your build use 'cmake -L' to find changeable variables and run cmake again with 'cmake -D = ...'.") + message("\nSummary:\n") + + set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES}) + list(SORT SUMMARY_COMPONENTS) + + set(LAST_TYPE NONE) + foreach ( SUMMARY_COMP ${SUMMARY_COMPONENTS}) + # split path to type and name + string(REPLACE "/" ";" SUMMARY_COMP_LIST ${SUMMARY_COMP}) + list(GET SUMMARY_COMP_LIST 0 SUMMARY_COMP_TYPE) + list(LENGTH SUMMARY_COMP_LIST SUMMARY_COMP_LIST_LENGTH) + if ( SUMMARY_COMP_LIST_LENGTH GREATER 1 ) + list(GET SUMMARY_COMP_LIST 1 SUMMARY_COMP_NAME) + else() + set(SUMMARY_COMP_NAME ${SUMMARY_COMP}) + endif() + if ( NOT ${LAST_TYPE} STREQUAL ${SUMMARY_COMP_TYPE}) + message("\n--->>> ${SUMMARY_COMP_TYPE}") + set(LAST_TYPE ${SUMMARY_COMP_TYPE}) + endif() + if (${SUMMARY_COMP}) + message("Enabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )") + else() + message("Disabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )") + endif() + endforeach() + + list(SORT ALL_FEATURES) + message("\n--->>> Features") + foreach ( FEATURE ${ALL_FEATURES}) + if ( ${FEATURE} ) + message("Enabled ${FEATURE} ( ${${FEATURE}_REASON} )") + else() + message("Disabled ${FEATURE} ( ${${FEATURE}_REASON} )") + endif() + endforeach() + + if (XSL_PROCESSING) + if (XSLTS) + message("\nProcessing XSLT files: ${XSLTS}") + else() + message("\nProcessing XSLT files: NONE") + endif(XSLTS) + message("See navit/xslt for available XSLT files, and put them into " + "cache variable 'XSLTS' (without extension .xslt).") + endif(XSL_PROCESSING) + + message("\nTo configure your build use 'cmake -L' to find changeable variables and run cmake again with 'cmake -D = ...'.") endif(NOT NAVIT_DEPENDENCY_ERROR) add_subdirectory (navit) @@ -863,5 +863,5 @@ add_subdirectory (man) if (USE_NATIVE_LANGUAGE_SUPPORT) - add_subdirectory (po) + add_subdirectory (po) endif(USE_NATIVE_LANGUAGE_SUPPORT) -- cgit v1.2.1