1 set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit")
2 set(MACOSX_BUNDLE_BUNDLE_NAME "Navit")
5 if(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$")
6 set(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-NOTFOUND)
7 endif(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$")
9 enable_language(CXX OPTIONAL)
10 endif(NOT DISABLE_CXX)
12 cmake_minimum_required(VERSION 2.6)
13 cmake_policy(VERSION 2.6)
15 set(PACKAGE_VERSION "0.5.0")
16 set(PACKAGE_NAME "navit-svn")
18 set(PACKAGE_STRING "${PACKAGE} ${PACKAGE_VERSION}")
20 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
21 include("${PROJECT_SOURCE_DIR}/cmake/navit_macros.cmake")
23 IF(NOT CMAKE_BUILD_TYPE)
24 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
25 ENDIF(NOT CMAKE_BUILD_TYPE)
29 set(SHARE_DIR share/navit)
30 set(LOCALE_DIR share/locale)
31 set(IMAGE_DIR share/navit/xpm)
33 IF(UNIX AND NOT ANDROID AND NOT APPLE)
35 MESSAGE(STATUS "LIBDIR variable is not defined. It will be autodetected now.")
36 MESSAGE(STATUS "You can set it manually with -DLIBDIR=<value>")
38 IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
40 MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
41 ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4)
43 MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
44 ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
46 GET_FILENAME_COMPONENT (LIB_DIR ${LIBDIR} NAME)
47 MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
49 ELSE (UNIX AND NOT ANDROID AND NOT APPLE)
51 ENDIF (UNIX AND NOT ANDROID AND NOT APPLE)
53 foreach(EXTRA_MODULE ${EXTRA_MODULES})
54 add_module(${EXTRA_MODULE} "extra module specified" TRUE)
58 list(APPEND NAVIT_LIBS ${EXTRA_LIBS})
62 include_directories(${EXTRA_INCLUDES})
66 link_directories(${EXTRA_LIBDIR})
69 ### Detect environment
71 add_plugin(support/ezxml "native Glib found" FALSE)
72 add_plugin(support/glib "native Glib found" FALSE)
73 add_plugin(support/zlib "native zlib found" FALSE)
74 add_plugin(support/libpng "native libpng found" FALSE)
75 add_plugin(support/wordexp "native wordexp found" FALSE)
76 add_module(font/freetype "freetype not found" FALSE)
77 add_module(graphics/android "FreeType library not found" FALSE)
78 add_module(graphics/gd "FreeType library not found" FALSE)
79 add_module(graphics/gtk_drawing_area "FreeType library not found" FALSE)
80 add_module(graphics/opengl "FreeType library not found" FALSE)
81 add_module(graphics/sdl "FreeType library not found" FALSE)
82 add_module(graphics/qt_qpainter "Qt libraries not found" FALSE)
83 add_module(gui/qml "Qt Declarative not found" FALSE)
84 add_module(gui/gtk "GTK libs not found" FALSE)
85 add_module(vehicle/gpsd "gpsd lib not found" FALSE)
86 add_module(vehicle/gypsy "gypsy lib not found" FALSE)
87 add_module(vehicle/maemo "Default" FALSE)
88 add_module(binding/win32 "Default" FALSE)
89 add_module(binding/dbus "dbus-glib-1 not found" FALSE)
90 add_module(speech/dbus "dbus-glib-1 not found" FALSE)
91 add_module(speech/cmdline "neither system() nor CreateProcess() found" FALSE)
92 add_module(vehicle/gpsd_dbus "dbus-glib-1 not found" FALSE)
93 add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
94 add_module(autoload/osso "Default" FALSE)
95 add_module(map/garmin "Garmin library not found" FALSE)
96 add_feature(ENABLE_NLS "default" TRUE)
99 INCLUDE (CheckIncludeFiles)
100 INCLUDE (CheckLibraryExists)
101 INCLUDE (CheckFunctionExists)
102 INCLUDE (CheckSymbolExists)
104 find_package(Gmodule)
106 find_package(Freetype)
108 find_package(SDL_ttf)
109 find_package(SDL_image)
112 find_package(GTK2 2.6 COMPONENTS gtk)
113 find_package(Gettext)
115 find_package(DBusGLib)
116 find_package(OpenSSL)
117 find_package(Threads)
118 libfind_pkg_check_modules(FONTCONFIG fontconfig)
121 SET(QT_USE_QTSVG TRUE)
122 SET(QT_USE_QTXML TRUE)
123 SET(QT_USE_QTDECLARATIVE TRUE)
124 find_package(Qt4 COMPONENTS QtCore QtGui QtXml QtDeclarative QtSvg OPTIONAL)
125 endif (NOT DISABLE_QT)
126 #pkg-config based detection
127 find_package(PkgConfig)
129 pkg_check_modules(QUESOGLC quesoglc)
130 pkg_check_modules(LIBGPS libgps)
131 pkg_check_modules(LIBLOCATION liblocation)
132 pkg_check_modules(LIBOSSO libosso)
133 pkg_check_modules(LIBGPS19 libgps>=2.90)
134 pkg_check_modules(LIBGARMIN libgarmin)
135 endif(PKG_CONFIG_FOUND)
137 CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP)
138 CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
139 CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
140 CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
141 CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
142 CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
143 CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
144 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
145 CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES)
146 CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL)
147 CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
148 CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
149 CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
150 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
151 CHECK_SYMBOL_EXISTS(system stdlib.h HAVE_SYSTEM)
152 CHECK_SYMBOL_EXISTS(CreateProcess windows.h HAVE_CREATEPROCESS)
153 CHECK_SYMBOL_EXISTS(stpcpy string.h HAVE_STPCPY)
154 CHECK_FUNCTION_EXISTS(sbrk HAVE_SBRK)
155 CHECK_FUNCTION_EXISTS(getdelim HAVE_GETDELIM)
156 CHECK_FUNCTION_EXISTS(getline HAVE_GETLINE)
160 #Required libraries, supplied with navit
161 if (NOT HAVE_LIBINTL)
162 add_plugin(intl_cmake "native libintl missing" TRUE)
163 set(USE_LIBGNUINTL TRUE)
165 CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL)
167 list(APPEND NAVIT_LIBS intl)
170 endif(NOT HAVE_LIBINTL)
173 if (CMAKE_USE_PTHREADS_INIT)
174 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
175 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
176 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
177 endif(CMAKE_USE_PTHREADS_INIT)
180 include_directories(${Glib_INCLUDE_DIRS})
181 list(APPEND NAVIT_LIBS ${Glib_LIBRARIES})
183 set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS})
187 include_directories(${Gmodule_INCLUDE_DIRS})
188 list(APPEND NAVIT_LIBS ${Gmodule_LIBRARIES})
192 include_directories(${ZLIB_INCLUDE_DIRS})
193 list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES})
195 message(STATUS "using internal zlib")
196 set_with_reason(support/zlib "native zlib missing" TRUE)
198 if(OPENSSL_CRYPTO_LIBRARIES)
199 set(HAVE_LIBCRYPTO 1)
200 include_directories(${OPENSSL_INCLUDE_DIR})
201 list(APPEND NAVIT_LIBS ${OPENSSL_CRYPTO_LIBRARIES})
205 include_directories(${PNG_INCLUDE_DIR})
206 list(APPEND NAVIT_LIBS ${PNG_LIBRARIES})
208 message(STATUS "using internal libpng")
209 set_with_reason(support/libpng "native libpng missing" TRUE)
211 if (NOT HAVE_WORDEXP)
212 message(STATUS "wordexp.h not found. use internal wordexp")
213 set_with_reason(support/wordexp "native wordexp missing" TRUE)
216 set_with_reason(support/ezxml "Glib not found" TRUE)
220 pkg_check_modules(FRIBIDI fribidi)
221 pkg_check_modules(FRIBIDI2 fribidi>=0.19.0)
222 include_directories(${FREETYPE_INCLUDE_DIRS})
223 set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LDFLAGS};${FRIBIDI_LIBRARIES}")
225 MESSAGE("No freetype library found, graphics modules may not be available")
226 set_with_reason(graphics/android "FreeType library not found" FALSE)
227 set_with_reason(graphics/gd "FreeType library not found" FALSE)
228 set_with_reason(graphics/gtk_drawing_area "FreeType library not found" FALSE)
229 set_with_reason(graphics/opengl "FreeType library not found" FALSE)
230 set_with_reason(graphics/sdl "FreeType library not found" FALSE)
231 endif(FREETYPE_FOUND)
234 set(HAVE_FONTCONFIG 1)
235 endif(FONTCONFIG_FOUND)
238 if (QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND FREETYPE_FOUND)
239 include(${QT_USE_FILE})
240 set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE ${QT_LIBRARIES})
242 if (QT_QTDECLARATIVE_FOUND AND QT_QTXML_FOUND)
243 set_with_reason(gui/qml "Qt Declarative found" TRUE ${QT_LIBRARIES})
248 elseif( USE_SVG AND graphics/qt_qpainter)
249 message( WARNING "QT compiled without SVG support")
255 include_directories(${GTK2_INCLUDE_DIRS})
257 set_with_reason(gui/gtk "GTK libs found" TRUE ${GTK2_LIBRARIES})
259 set_with_reason(graphics/gtk_drawing_area "GTK libs found" TRUE ${GTK2_LIBRARIES})
260 endif(FREETYPE_FOUND)
263 CHECK_LIBRARY_EXISTS(freeimage FreeImage_Load "" HAVE_FREEIMAGE)
264 if (USE_OPENGLES OR USE_OPENGLES2)
265 CHECK_LIBRARY_EXISTS(EGL eglInitialize "" HAVE_EGL)
266 endif(USE_OPENGLES OR USE_OPENGLES2)
268 if (OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND AND OPENGL_INCLUDE_DIR)
269 message (STATUS "opengl found: ${OPENGL_gl_LIBRARY}")
270 include_directories(${OPENGL_INCLUDE_DIR})
272 set(USE_OPENGLES TRUE)
273 set(GRAPHICS_OPENGL_LIBRARY GLESv2 EGL)
274 elseif (USE_OPENGLES)
275 set(GRAPHICS_OPENGL_LIBRARY GLESv1_CM EGL)
277 set(GRAPHICS_OPENGL_LIBRARY ${OPENGL_gl_LIBRARY};${OPENGL_glu_LIBRARY};${GLUT_glut_LIBRARY})
280 list(APPEND GRAPHICS_OPENGL_LIBRARY freeimage)
281 endif(HAVE_FREEIMAGE)
282 set_with_reason(graphics/opengl "Found OpenGL" TRUE ${GRAPHICS_OPENGL_LIBRARY})
284 message (STATUS "opengl not found")
287 message (STATUS "no Freetype found")
288 endif(FREETYPE_FOUND)
290 if(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND)
294 list(APPEND SDL_LIBRARY ${SDLTTF_LIBRARY})
296 set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY})
297 endif(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND)
300 set_with_reason(vehicle/gpsd "gpsd lib found" TRUE ${LIBGPS_LDFLAGS})
304 set_with_reason(vehicle/gypsy "gypsy lib found" TRUE)
308 include_directories(${LIBGARMIN_INCLUDE_DIRS})
309 set_with_reason(map/garmin "Garmin library found" TRUE ${LIBGARMIN_LDFLAGS})
310 endif(LIBGARMIN_FOUND)
313 include_directories(${DBusGLib_INCLUDE_DIRS})
314 set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
315 set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
316 set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
320 set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE speechd)
321 endif(HAVE_LIBSPEECHD)
324 set_with_reason(speech/cmdline "system() call is available" TRUE)
327 if (HAVE_CREATEPROCESS)
328 set_with_reason(speech/cmdline "CreateProcess() call is available" TRUE)
329 endif(HAVE_CREATEPROCESS)
332 execute_process(COMMAND echo "<test/>" COMMAND xgettext -L glade - RESULT_VARIABLE GETTEXT_RET)
333 if ("${GETTEXT_RET}" STREQUAL "0")
334 set(XGETTEXT_GLADE TRUE)
336 set(XGETTEXT_GLADE FALSE)
340 if (LIBLOCATION_FOUND)
341 set_with_reason(vehicle/maemo "Maemo location library found" TRUE ${LIBLOCATION_LIBRARIES})
342 endif(LIBLOCATION_FOUND)
345 set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES})
349 add_module(graphics/null "Default" TRUE)
350 add_module(osd/core "Default" TRUE)
351 add_module(vehicle/demo "Default" TRUE)
352 add_module(vehicle/file "Default" TRUE)
353 add_module(vehicle/null "Default" FALSE)
354 add_module(gui/internal "Default" TRUE)
355 add_module(map/binfile "Default" TRUE)
356 add_module(map/filter "Default" TRUE)
358 add_module(map/mg "Default" TRUE)
360 add_module_plugin(support/shapefile "Default" TRUE)
361 set(map_shapefile_INCLUDES "${CMAKE_SOURCE_DIR}/navit/support/shapefile")
362 #set(map_shapefile_LIBRARY_DIRS "${CMAKE_BINARY_DIR}/navit/support/shapefile")
363 set(map_shapefile_LIBS "support_shapefile")
364 add_module(map/shapefile "Default" TRUE)
365 add_module(map/textfile "Default" TRUE)
366 add_module(map/csv "Default" TRUE)
368 #Modules without test yet
369 add_module(plugin/pedestrian "Default" FALSE)
370 add_module(speech/android "Default" FALSE)
371 add_module(speech/espeak "Default" FALSE)
372 add_module(speech/iphone "Default" FALSE)
373 add_plugin(support/espeak "Default" FALSE)
374 add_module(vehicle/android "Default" FALSE)
375 add_module(vehicle/iphone "Default" FALSE)
376 add_module(vehicle/wince "Default" FALSE)
377 add_module(graphics/cocoa "Default" FALSE)
380 add_feature(USE_PLUGINS "default" TRUE)
381 add_feature(SHARED_LIBNAVIT "default" FALSE)
382 add_feature(USE_ROUTING "default" TRUE)
383 add_feature(USE_SVG "default" TRUE)
384 add_feature(SVG2PNG "default" TRUE)
385 add_feature(SAMPLE_MAP "default" TRUE)
387 IF(NOT svg2png_scaling)
388 set(svg2png_scaling 0 16 32 48 64 96)
390 IF(NOT svg2png_scaling_flag)
391 set(svg2png_scaling_flag 32)
393 IF(NOT svg2png_scaling_nav)
394 set(svg2png_scaling_nav 64)
397 add_feature(DBUS_USE_SYSTEM_BUS "default" FALSE)
398 add_feature(BUILD_MAPTOOL "default" TRUE)
399 add_feature(XSL_PROCESSING "default" TRUE)
401 find_program(XSLT_PROCESSOR NAMES saxon saxon8 saxon-xslt saxonb-xslt xsltproc transform.exe)
403 execute_process(COMMAND ${XSLT_PROCESSOR} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt
404 RESULT_VARIABLE SAXON_ERROR ERROR_QUIET)
406 set (XSLT_PROCESSOR_OPTIONS -snone)
409 cfg_feature(XSL_PROCESSING "Saxon missing" FALSE)
410 endif(XSLT_PROCESSOR)
412 if (NOT XSL_PROCESSING)
413 message(WARNING "XSLT processing disabled. You have to configure navit.xml yourself, or enable XSLT processing.")
416 ### Platform specific settings
418 SET(CACHE_SIZE 1048576)
419 endif(NOT CACHE_SIZE)
422 SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
423 add_module(graphics/win32 "Windows detected" TRUE)
424 add_plugin(support/win32 "Windows detected" TRUE)
426 SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I ${CMAKE_CURRENT_SOURCE_DIR}/navit/gui/win32/resources <DEFINES> -i <SOURCE> -o <OBJECT>")
427 set_with_reason(support/ezxml "Windows detected" TRUE)
428 set_with_reason(speech/espeak "Windows detected" TRUE)
429 set_with_reason(support/espeak "Windows detected" TRUE)
430 set_with_reason(binding/win32 "Windows detected" TRUE)
432 # vehicle_file is broken for windows. use vehicle_wince instead
433 # whicle_wince isn't buildable on non-CE windows ssytems
435 # plugins currently not supported on windows
436 set_with_reason(USE_PLUGINS "win32: currently not supported" FALSE)
438 set(HAVE_API_WIN32_BASE 1)
442 if(NOT graphics/qt_qpainter)
443 set_with_reason(USE_SVG "win32: SVGs currently not supported" FALSE)
444 else(NOT graphics/qt_qpainter)
445 MESSAGE(STATUS "win32: SVGs may not be supported by every available graphics")
446 endif(NOT graphics/qt_qpainter)
450 set(LOCALE_DIR locale)
454 if(HAVE_GTK2 AND NOT MSVC)
455 #GTK requires special compile flags
456 add_definitions("-mms-bitfields")
457 endif(HAVE_GTK2 AND NOT MSVC)
458 if(MSVC AND support/espeak)
459 add_definitions(-DPLATFORM_WINDOWS)
460 endif(MSVC AND support/espeak)
461 CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK)
463 list(APPEND NAVIT_LIBS ws2_32)
465 CHECK_LIBRARY_EXISTS(ws2 WSAStartup "" HAVE_WINSOCK_2)
468 list(APPEND NAVIT_LIBS ws2)
473 set(HAVE_PRAGMA_PACK 1)
474 add_plugin(support/xgetopt "Windows detected" TRUE)
479 set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
481 if (WIN32 AND NOT WINCE)
482 set(HAVE_PRAGMA_PACK 1)
483 set(HAVE_API_WIN32 1)
485 #set(BUILD_MAPTOOL FALSE)
486 set(SAMPLE_MAP FALSE)
487 list(APPEND NAVIT_LIBS winmm)
490 add_plugin(support/libc "wince detected" TRUE)
491 set(HAVE_PRAGMA_PACK 1)
492 set(HAVE_API_WIN32_CE 1)
493 set(BUILD_MAPTOOL FALSE)
494 set_with_reason(vehicle/file "wince: currently broken" FALSE)
495 set_with_reason(vehicle/wince "wince detected" TRUE)
497 if (APPLE OR USE_UIKIT)
498 set_with_reason(vehicle/iphone "apple detected" TRUE)
499 set_with_reason(graphics/cocoa "apple detected" TRUE)
500 if (EXISTS "${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks/VoiceServices.framework")
501 set_with_reason(speech/iphone "apple detected" TRUE)
503 set(BUILD_BUNDLE TRUE CACHE BOOLEAN "build an osx bundle")
506 set(LOCALEDIR "${LOCALE_DIR}/locale")
508 find_program(BZCAT NAMES bzcat)
510 if(CMAKE_CROSSCOMPILING)
511 cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE)
512 set(DOWNLOAD_SAMPLE_MAP TRUE)
514 cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE)
515 set(DOWNLOAD_SAMPLE_MAP TRUE)
516 endif(CMAKE_CROSSCOMPILING)
520 # for android API 3 compatiblity
521 SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,/data/data/org.navitproject.navit/lib/")
523 find_program(ANDROID_LOCATION NAMES android android.bat)
524 find_program(ANT_LOCATION NAMES ant)
525 if (NOT ANT_LOCATION)
526 message_error("Could not find ant. Please install ant and add it to the search path.")
528 if (NOT ANDROID_LOCATION)
529 message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the <android-sdk>/tools directory to the search path.")
531 if (NOT XSL_PROCESSING)
532 message(WARNING "XSLT processing disabled. You have to configure navit.xml yourself, or enable XSLT processing.")
534 set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
535 list(APPEND NAVIT_LIBS log)
536 set(HAVE_API_ANDROID 1)
537 set_with_reason(graphics/android "Android detected" TRUE)
538 set_with_reason(speech/android "Android detected" TRUE)
539 set_with_reason(vehicle/android "Android detected" TRUE)
540 set_with_reason(plugin/pedestrian "Android detected" TRUE)
541 cfg_feature(SHARED_LIBNAVIT "Android detected" TRUE)
543 add_feature(XPM2PNG "Android detected" TRUE)
544 set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -fPIC")
548 if(FREETYPE_FOUND AND NOT FONTCONFIG_FOUND)
549 add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/navit/fonts")
553 find_program(IMAGE_CONVERTER NAMES convert)
554 execute_process(COMMAND ${IMAGE_CONVERTER} -list format OUTPUT_VARIABLE CONVERT_FORMATS)
555 if(CONVERT_FORMATS MATCHES ".*XPM[ *][ ]*XPM[ ]*r[w-].*")
556 set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER})
559 set(CMAKE_APPBUNDLE_PATH "")
561 if (NOT IMAGE_CONVERTER_SVGZ)
562 set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4 inkscape)
563 set (CMAKE_FIND_APPBUNDLE "NEVER")
564 find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin)
565 if (NOT IMAGE_CONVERTER_SVGZ)
566 if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*")
567 set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER})
570 endif(NOT IMAGE_CONVERTER_SVGZ)
571 if (NOT IMAGE_CONVERTER_SVG)
572 set(IMAGE_CONVERTER_SVG ${IMAGE_CONVERTER_SVGZ})
573 endif(NOT IMAGE_CONVERTER_SVG)
575 message(STATUS "SVG2PNG-Converter: ${IMAGE_CONVERTER_SVGZ}")
576 if (NOT IMAGE_CONVERTER_SVGZ)
577 message(WARNING "No SVG2PNG converter found. Please install one of the following tools: ${SVG_CONVERTER_PROGS}, or imagemagick with svg support")
578 set_with_reason(SVG2PNG "no converter found" FALSE)
579 endif(NOT IMAGE_CONVERTER_SVGZ)
583 message(STATUS "XPM2PNG-Converter: ${IMAGE_CONVERTER_XPM}")
584 if (NOT IMAGE_CONVERTER_XPM)
585 message(WARNING "No XPM2PNG converter found. Please install imagemagick with xpm support")
586 set_with_reason(XPM2PNG "no converter found" FALSE)
587 endif(NOT IMAGE_CONVERTER_XPM)
590 set(XSLTS ${XSLTS} CACHE STRING "define a semicolon seperated list of XSLTs to process")
594 set(MODULE_BUILD_TYPE "MODULE")
595 add_definitions("-fPIC")
596 list(APPEND NAVIT_LIBS dl)
598 set(MODULE_BUILD_TYPE "STATIC")
600 message(STATUS "Use plugins: ${MODULE_BUILD_TYPE}")
603 set(NAVIT_CORE_BUILD_TYPE "STATIC")
604 else(SHARED_LIBNAVIT)
605 set(NAVIT_CORE_BUILD_TYPE "SHARED")
606 endif(SHARED_LIBNAVIT)
608 CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
609 CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
610 CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
611 CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
612 CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN)
613 CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC)
614 CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN)
615 CHECK_FUNCTION_EXISTS (popen HAVE_POPEN)
616 CHECK_FUNCTION_EXISTS (_atoi64 HAVE__ATOI64)
618 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
620 add_definitions("-Wall")
622 add_definitions("${EXTRA_DEFINES}")
625 if (NOT NAVIT_DEPENDENCY_ERROR)
626 message("\nSummary:\n")
628 set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES})
629 list(SORT SUMMARY_COMPONENTS)
632 foreach ( SUMMARY_COMP ${SUMMARY_COMPONENTS})
633 # split path to type and name
634 string(REPLACE "/" ";" SUMMARY_COMP_LIST ${SUMMARY_COMP})
635 list(GET SUMMARY_COMP_LIST 0 SUMMARY_COMP_TYPE)
636 list(LENGTH SUMMARY_COMP_LIST SUMMARY_COMP_LIST_LENGTH)
637 if ( SUMMARY_COMP_LIST_LENGTH GREATER 1 )
638 list(GET SUMMARY_COMP_LIST 1 SUMMARY_COMP_NAME)
640 set(SUMMARY_COMP_NAME ${SUMMARY_COMP})
642 if ( NOT ${LAST_TYPE} STREQUAL ${SUMMARY_COMP_TYPE})
643 message("\n--->>> ${SUMMARY_COMP_TYPE}")
644 set(LAST_TYPE ${SUMMARY_COMP_TYPE})
647 message("Enabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
649 message("Disabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
653 list(SORT ALL_FEATURES)
654 message("\n--->>> Features")
655 foreach ( FEATURE ${ALL_FEATURES})
657 message("Enabled ${FEATURE} ( ${${FEATURE}_REASON} )")
659 message("Disabled ${FEATURE} ( ${${FEATURE}_REASON} )")
665 message("\nProcessing XSLTS: ${XSLTS}")
667 message("\nProcessing XSLTS: NONE")
669 endif(XSL_PROCESSING)
671 message("\nTo configure your build use 'cmake -L' to find changeable variables and run cmake again with 'cmake -D <var-name>=<your value> ...'.")
672 endif(NOT NAVIT_DEPENDENCY_ERROR)
674 add_subdirectory (navit)
675 add_subdirectory (man)
679 add_subdirectory (po)