/[zanavi_public1]/navit/CMakeLists.txt
ZANavi

Contents of /navit/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations) (download)
Fri Oct 28 21:19:04 2011 UTC (9 years, 5 months ago) by zoff99
File MIME type: text/plain
File size: 20189 byte(s)
import files
1 zoff99 2 project(navit)
2    
3     cmake_minimum_required(VERSION 2.6)
4     cmake_policy(VERSION 2.6)
5    
6     set(PACKAGE_VERSION "0.5.0")
7     set(PACKAGE_NAME "navit-svn")
8     set(PACKAGE "navit")
9     set(PACKAGE_STRING "${PACKAGE} ${PACKAGE_VERSION}")
10    
11     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
12     include("${PROJECT_SOURCE_DIR}/cmake/navit_macros.cmake")
13    
14     IF(NOT CMAKE_BUILD_TYPE)
15     SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
16     ENDIF(NOT CMAKE_BUILD_TYPE)
17    
18     # install path
19     set(BIN_DIR bin)
20     set(SHARE_DIR share/navit)
21     set(LOCALE_DIR share)
22     set(IMAGE_DIR share/navit/xpm)
23     set(LIB_DIR lib)
24    
25     foreach(EXTRA_MODULE ${EXTRA_MODULES})
26     add_module(${EXTRA_MODULE} "extra module specified" TRUE)
27     endforeach()
28    
29     if (EXTRA_LIBS)
30     list(APPEND NAVIT_LIBS ${EXTRA_LIBS})
31     endif(EXTRA_LIBS)
32    
33     ### Detect environment
34    
35     add_plugin(support/ezxml "native Glib found" FALSE)
36     add_plugin(support/glib "native Glib found" FALSE)
37     add_plugin(support/zlib "native zlib found" FALSE)
38     add_plugin(support/libpng "native libpng found" FALSE)
39     add_plugin(support/wordexp "native wordexp found" FALSE)
40     add_module(font/freetype "freetype not found" FALSE)
41     add_module(graphics/android "FreeType library not found" FALSE)
42     add_module(graphics/gd "FreeType library not found" FALSE)
43     add_module(graphics/gtk_drawing_area "FreeType library not found" FALSE)
44     add_module(graphics/opengl "FreeType library not found" FALSE)
45     add_module(graphics/sdl "FreeType library not found" FALSE)
46     add_module(graphics/qt_qpainter "Qt libraries not found" FALSE)
47     add_module(gui/qml "Qt Declarative not found" FALSE)
48     add_module(gui/gtk "GTK libs not found" FALSE)
49     add_module(vehicle/gpsd "gpsd lib not found" FALSE)
50     add_module(vehicle/gypsy "gypsy lib not found" FALSE)
51     add_module(vehicle/maemo "Default" FALSE)
52     add_module(binding/dbus "dbus-glib-1 not found" FALSE)
53     add_module(speech/dbus "dbus-glib-1 not found" FALSE)
54     add_module(vehicle/gpsd_dbus "dbus-glib-1 not found" FALSE)
55     add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
56     add_module(autoload/osso "Default" FALSE)
57     add_module(map/garmin "Garmin library not found" FALSE)
58     add_feature(ENABLE_NLS "default" TRUE)
59    
60     INCLUDE (CPack)
61     INCLUDE (CheckIncludeFiles)
62     INCLUDE (CheckLibraryExists)
63     INCLUDE (CheckFunctionExists)
64     find_package(Glib)
65     find_package(Gmodule)
66     find_package(ZLIB)
67     find_package(Freetype)
68     find_package(SDL)
69     find_package(SDL_ttf)
70     find_package(SDL_image)
71     find_package(OpenGL)
72     find_package(GLUT)
73     find_package(GTK2 2.6 COMPONENTS gtk)
74     find_package(Gettext)
75     find_package(PNG)
76     find_package(DBusGLib)
77     find_package(OpenSSL)
78     find_package(Threads)
79     libfind_pkg_check_modules(FONTCONFIG fontconfig)
80     #Qt detection
81     SET(QT_USE_QTSVG TRUE)
82     SET(QT_USE_QTXML TRUE)
83     SET(QT_USE_QTDECLARATIVE TRUE)
84     find_package(Qt4 COMPONENTS QtCore QtGui QtXml QtDeclarative QtSvg OPTIONAL)
85     #pkg-config based detection
86     find_package(PkgConfig)
87     if(PKG_CONFIG_FOUND)
88     pkg_check_modules(QUESOGLC quesoglc)
89     pkg_check_modules(LIBGPS libgps)
90     pkg_check_modules(LIBLOCATION liblocation)
91     pkg_check_modules(LIBOSSO libosso)
92     pkg_check_modules(LIBGPS19 libgps>=2.90)
93     pkg_check_modules(LIBGARMIN libgarmin)
94     endif(PKG_CONFIG_FOUND)
95     #Simple checks
96     CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP)
97     CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
98     CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
99     CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
100     CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
101     CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
102     CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
103     CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES)
104     CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL)
105     CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
106     CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
107     CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
108     CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
109    
110     ### Configure build
111     #Required libraries, supplied with navit
112     if (NOT HAVE_LIBINTL)
113     add_plugin(intl_cmake "native libintl missing" TRUE)
114     set(USE_LIBGNUINTL TRUE)
115     else()
116     CHECK_LIBRARY_EXISTS(intl libintl_fprintf "" NEEDS_LIBINTL)
117     if (NEEDS_LIBINTL)
118     list(APPEND NAVIT_LIBS intl)
119     set(INTL_LIBS intl)
120     endif(NEEDS_LIBINTL)
121     endif(NOT HAVE_LIBINTL)
122    
123    
124     if (CMAKE_USE_PTHREADS_INIT)
125     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
126     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
127     set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_THREAD_LIBS_INIT}")
128     endif(CMAKE_USE_PTHREADS_INIT)
129     if (Glib_FOUND)
130     set(HAVE_GLIB 1)
131     include_directories(${Glib_INCLUDE_DIRS})
132     list(APPEND NAVIT_LIBS ${Glib_LIBRARIES})
133     else(Glib_FOUND)
134     set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS})
135     endif(Glib_FOUND)
136     if (Gmodule_FOUND)
137     set(HAVE_GMODULE 1)
138     include_directories(${Gmodule_INCLUDE_DIRS})
139     list(APPEND NAVIT_LIBS ${Gmodule_LIBRARIES})
140     endif(Gmodule_FOUND)
141     if(ZLIB_FOUND)
142     set(HAVE_ZLIB 1)
143     include_directories(${ZLIB_INCLUDE_DIRS})
144     list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES})
145     else(ZLIB_FOUND)
146     message(STATUS "using internal zlib")
147     set_with_reason(support/zlib "native zlib missing" TRUE)
148     endif(ZLIB_FOUND)
149     if(OPENSSL_CRYPTO_LIBRARIES)
150     set(HAVE_LIBCRYPTO 1)
151     include_directories(${OPENSSL_INCLUDE_DIR})
152     list(APPEND NAVIT_LIBS ${OPENSSL_CRYPTO_LIBRARIES})
153     endif()
154     if(PNG_FOUND)
155     set(HAVE_PNG 1)
156     include_directories(${PNG_INCLUDE_DIR})
157     list(APPEND NAVIT_LIBS ${PNG_LIBRARIES})
158     else(PNG_FOUND)
159     message(STATUS "using internal libpng")
160     set_with_reason(support/libpng "native libpng missing" TRUE)
161     endif(PNG_FOUND)
162     if (NOT HAVE_WORDEXP)
163     message(STATUS "wordexp.h not found. use internal wordexp")
164     set_with_reason(support/wordexp "native wordexp missing" TRUE)
165     endif()
166     if (NOT Glib_FOUND)
167     set_with_reason(support/ezxml "Glib not found" TRUE)
168     endif()
169    
170     if(FREETYPE_FOUND)
171     pkg_check_modules(FRIBIDI fribidi)
172     pkg_check_modules(FRIBIDI2 fribidi>=0.19.0)
173     include_directories(${FREETYPE_INCLUDE_DIRS})
174     set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LIBRARIES};${FRIBIDI_LIBRARIES}")
175     add_subdirectory( "${CMAKE_CURRENT_SOURCE_DIR}/navit/fonts")
176     else(FREETYPE_FOUND)
177     MESSAGE("No freetype library found, graphics modules may not be available")
178     set_with_reason(graphics/android "FreeType library not found" FALSE)
179     set_with_reason(graphics/gd "FreeType library not found" FALSE)
180     set_with_reason(graphics/gtk_drawing_area "FreeType library not found" FALSE)
181     set_with_reason(graphics/opengl "FreeType library not found" FALSE)
182     set_with_reason(graphics/sdl "FreeType library not found" FALSE)
183     endif(FREETYPE_FOUND)
184    
185     if(FONTCONFIG_FOUND)
186     set(HAVE_FONTCONFIG 1)
187     endif(FONTCONFIG_FOUND)
188    
189     if (QT_FOUND)
190     if (QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND FREETYPE_FOUND)
191     include(${QT_USE_FILE})
192     set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE ${QT_LIBRARIES})
193    
194     if (QT_QTDECLARATIVE_FOUND AND QT_QTXML_FOUND)
195     set_with_reason(gui/qml "Qt Declarative found" TRUE ${QT_LIBRARIES})
196     endif()
197    
198     if (QT_QTSVG_FOUND)
199     set(HAVE_QT_SVG 1)
200     elseif( USE_SVG AND graphics/qt_qpainter)
201     message( WARNING "QT compiled without SVG support")
202     endif()
203     endif()
204     endif(QT_FOUND)
205    
206     if(GTK2_FOUND)
207     include_directories(${GTK2_INCLUDE_DIRS})
208     set(HAVE_GTK2 1)
209     set_with_reason(gui/gtk "GTK libs found" TRUE ${GTK2_LIBRARIES})
210     if(FREETYPE_FOUND)
211     set_with_reason(graphics/gtk_drawing_area "GTK libs found" TRUE ${GTK2_LIBRARIES})
212     endif(FREETYPE_FOUND)
213     endif(GTK2_FOUND)
214    
215     CHECK_LIBRARY_EXISTS(freeimage FreeImage_Load "" FREEIMAGE_FOUND)
216     if (QUESOGLC_FOUND AND FREETYPE_FOUND)
217     if (OPENGL_FOUND AND OPENGL_GLU_FOUND AND OPENGL_INCLUDE_DIR AND FREEIMAGE_FOUND)
218     message (STATUS "opengl found: ${OPENGL_gl_LIBRARY}")
219     include_directories(${OPENGL_INCLUDE_DIR})
220     set_with_reason(graphics/opengl "Found OpenGL and Quesoglc" TRUE ${OPENGL_gl_LIBRARY};${OPENGL_glu_LIBRARY};${GLUT_glut_LIBRARY};freeimage)
221     else()
222     message (STATUS "opengl not found")
223     endif()
224     else()
225     message (STATUS "no glc implementation found. Install Quesoglc for OpenGL support")
226     endif(QUESOGLC_FOUND AND FREETYPE_FOUND)
227    
228     if(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND)
229     set(SDL_IMAGE 1)
230     if(SDLTTF_FOUND)
231     set(SDL_TTF 1)
232     list(APPEND SDL_LIBRARY ${SDLTTF_LIBRARY})
233     endif(SDLTTF_FOUND)
234     set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY})
235     endif(SDL_FOUND AND SDLIMAGE_FOUND AND FREETYPE_FOUND)
236    
237     if (LIBGPS_FOUND)
238     set_with_reason(vehicle/gpsd "gpsd lib found" TRUE ${LIBGPS_LIBRARIES})
239     endif(LIBGPS_FOUND)
240    
241     if (GYPSY_FOUND)
242     set_with_reason(vehicle/gypsy "gypsy lib found" TRUE)
243     endif(GYPSY_FOUND)
244    
245     if (LIBGARMIN_FOUND)
246     set_with_reason(map/garmin "Garmin library found" TRUE ${LIBGARMIN_LIBRARIES})
247     endif(LIBGARMIN_FOUND)
248    
249     if(DBusGLib_FOUND)
250     include_directories(${DBusGLib_INCLUDE_DIRS})
251     set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
252     set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
253     set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
254     endif()
255    
256     if (HAVE_LIBSPEECHD)
257     set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE speechd)
258     endif(HAVE_LIBSPEECHD)
259    
260     if (GETTEXT_FOUND)
261     execute_process(COMMAND echo "<test/>" COMMAND xgettext -L glade - RESULT_VARIABLE GETTEXT_RET)
262     if ("${GETTEXT_RET}" STREQUAL "0")
263     set(XGETTEXT_GLADE TRUE)
264     else()
265     set(XGETTEXT_GLADE FALSE)
266     endif()
267     endif(GETTEXT_FOUND)
268    
269     if (LIBLOCATION_FOUND)
270     set_with_reason(vehicle/maemo "Maemo location library found" TRUE ${LIBLOCATION_LIBRARIES})
271     endif(LIBLOCATION_FOUND)
272    
273     if (LIBOSSO_FOUND)
274     set_with_reason(autoload/osso "Maemo osso library found" TRUE ${LIBOSSO_LIBRARIES})
275     endif(LIBOSSO_FOUND)
276    
277     #Independent modules
278     add_module(graphics/null "Default" TRUE)
279     add_module(osd/core "Default" TRUE)
280     add_module(vehicle/demo "Default" TRUE)
281     add_module(vehicle/file "Default" TRUE)
282     add_module(vehicle/null "Default" FALSE)
283     add_module(gui/internal "Default" TRUE)
284     add_module(map/binfile "Default" TRUE)
285     add_module(map/filter "Default" TRUE)
286     if(NOT MSVC)
287     add_module(map/mg "Default" TRUE)
288     endif(NOT MSVC)
289     add_module(map/shapefile "Default" TRUE)
290     add_module(map/textfile "Default" TRUE)
291     add_module(map/csv "Default" TRUE)
292    
293     #Modules without test yet
294     add_module(plugin/pedestrian "Default" FALSE)
295     add_module(speech/android "Default" FALSE)
296     add_module(speech/espeak "Default" FALSE)
297     add_plugin(support/espeak "Default" FALSE)
298     add_module(vehicle/android "Default" FALSE)
299     add_module(vehicle/iphone "Default" FALSE)
300     add_module(vehicle/wince "Default" FALSE)
301    
302     # other features
303     add_feature(USE_PLUGINS "default" TRUE)
304     add_feature(SHARED_LIBNAVIT "default" FALSE)
305     add_feature(USE_ROUTING "default" TRUE)
306     add_feature(USE_SVG "default" TRUE)
307     add_feature(SVG2PNG "default" TRUE)
308     add_feature(SAMPLE_MAP "default" TRUE)
309    
310     IF(NOT svg2png_scaling)
311     set(svg2png_scaling 0 32 48 64)
312     ENDIF()
313     IF(NOT svg2png_scaling_flag)
314     set(svg2png_scaling_flag 32)
315     ENDIF()
316     IF(NOT svg2png_scaling_nav)
317     set(svg2png_scaling_nav 64)
318     ENDIF()
319    
320     add_feature(DBUS_USE_SYSTEM_BUS "default" FALSE)
321     add_feature(BUILD_MAPTOOL "default" TRUE)
322     add_feature(XSL_PROCESSING "default" TRUE)
323    
324     find_program(SAXON NAMES saxon saxon8 saxon-xslt saxonb-xslt)
325     if(NOT SAXON)
326     cfg_feature(XSL_PROCESSING "Saxon missing" FALSE)
327     endif()
328    
329     if (NOT XSL_PROCESSING)
330     message(WARNING "XSLT processing disabled. You have to configure navit.xml yourself, or enable XSLT processing.")
331     endif()
332    
333     ### Platform specific settings
334     if(NOT CACHE_SIZE)
335     SET(CACHE_SIZE 1048576)
336     endif(NOT CACHE_SIZE)
337    
338     if(WIN32 OR WINCE)
339     SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
340     add_module(graphics/win32 "Windows detected" TRUE)
341     add_plugin(support/win32 "Windows detected" TRUE)
342    
343     SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I ${CMAKE_CURRENT_SOURCE_DIR}/navit/gui/win32/resources <DEFINES> -i <SOURCE> -o <OBJECT>")
344     set_with_reason(support/ezxml "Windows detected" TRUE)
345     set_with_reason(speech/espeak "Windows detected" TRUE)
346     set_with_reason(support/espeak "Windows detected" TRUE)
347    
348     # vehicle_file is broken for windows. use vehicle_wince instead
349     # whicle_wince isn't buildable on non-CE windows ssytems
350    
351     # plugins currently not supported on windows
352     set_with_reason(USE_PLUGINS "win32: currently not supported" FALSE)
353    
354     set(HAVE_API_WIN32_BASE 1)
355     set(EZXML_NOMMAP 1)
356    
357     # Image stuff
358     if(NOT graphics/qt_qpainter)
359     set_with_reason(USE_SVG "win32: SVGs currently not supported" FALSE)
360     else(NOT graphics/qt_qpainter)
361     MESSAGE(STATUS "win32: SVGs may not be supported by every available graphics")
362     endif(NOT graphics/qt_qpainter)
363    
364     set(BIN_DIR ./)
365     set(SHARE_DIR ./)
366     set(LOCALE_DIR locale)
367     set(IMAGE_DIR xpm)
368    
369    
370     if(HAVE_GTK2 AND NOT MSVC)
371     #GTK requires special compile flags
372     add_definitions("-mms-bitfields")
373     endif(HAVE_GTK2 AND NOT MSVC)
374     if(MSVC AND support/espeak)
375     add_definitions(-DPLATFORM_WINDOWS)
376     endif(MSVC AND support/espeak)
377     CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK)
378     if(HAVE_WINSOCK)
379     list(APPEND NAVIT_LIBS ws2_32)
380     else()
381     CHECK_LIBRARY_EXISTS(ws2 WSAStartup "" HAVE_WINSOCK_2)
382     if(HAVE_WINSOCK_2)
383     set(HAVE_WINSOCK 1)
384     list(APPEND NAVIT_LIBS ws2)
385     endif()
386     endif(HAVE_WINSOCK)
387    
388     if(MSVC)
389     add_plugin(support/xgetopt "Windows detected" TRUE)
390     set(ENABLE_NLS FALSE)
391     else(MSVC)
392     set(ENABLE_NLS TRUE)
393     endif(MSVC)
394     enable_language(RC)
395    
396     set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
397     endif()
398     if (WIN32)
399     set(HAVE_API_WIN32 1)
400     set(HAVE_STDINT_H 1)
401     #set(BUILD_MAPTOOL FALSE)
402     set(SAMPLE_MAP FALSE)
403     list(APPEND NAVIT_LIBS winmm)
404     endif()
405     if(WINCE)
406     add_plugin(support/libc "wince detected" TRUE)
407     set(HAVE_API_WIN32_CE 1)
408     set(BUILD_MAPTOOL FALSE)
409     set_with_reason(vehicle/file "wince: currently broken" FALSE)
410     set_with_reason(vehicle/wince "wince detected" TRUE)
411     endif()
412    
413     set(LOCALEDIR "${LOCALE_DIR}/locale")
414    
415     find_program(BZCAT NAMES bzcat)
416     if (SAMPLE_MAP)
417     if(CMAKE_CROSSCOMPILING)
418     cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE)
419     elseif(NOT BZCAT)
420     cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE)
421     endif(CMAKE_CROSSCOMPILING)
422     endif(SAMPLE_MAP)
423    
424     if(ANDROID)
425     find_program(ANDROID_LOCATION NAMES android android.bat)
426     find_program(ANT_LOCATION NAMES ant)
427     if (NOT ANT_LOCATION)
428     message_error("Could not find ant. Please install ant and add it to the search path.")
429     endif()
430     if (NOT ANDROID_LOCATION)
431     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.")
432     endif()
433     if (NOT XSL_PROCESSING)
434     message(WARNING "XSLT processing disabled. You have to configure navit.xml yourself, or enable XSLT processing.")
435     endif()
436     set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
437     list(APPEND NAVIT_LIBS log)
438     set(HAVE_API_ANDROID 1)
439     set_with_reason(graphics/android "Android detected" TRUE)
440     set_with_reason(speech/android "Android detected" TRUE)
441     set_with_reason(vehicle/android "Android detected" TRUE)
442     set_with_reason(plugin/pedestrian "Android detected" TRUE)
443     cfg_feature(SHARED_LIBNAVIT "Android detected" TRUE)
444    
445     add_feature(XPM2PNG "Android detected" TRUE)
446     set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -fPIC")
447    
448     endif(ANDROID)
449    
450     # Image conversion
451     find_program(IMAGE_CONVERTER NAMES convert)
452     execute_process(COMMAND ${IMAGE_CONVERTER} -list format OUTPUT_VARIABLE CONVERT_FORMATS)
453     if(CONVERT_FORMATS MATCHES ".*XPM[ *][ ]*XPM[ ]*r[w-].*")
454     set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER})
455     endif()
456    
457     if (SVG2PNG)
458     if (NOT IMAGE_CONVERTER_SVGZ)
459     set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4)
460     find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS})
461     if (NOT IMAGE_CONVERTER_SVGZ)
462     if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*")
463     set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER})
464     endif()
465     endif()
466     endif(NOT IMAGE_CONVERTER_SVGZ)
467     if (NOT IMAGE_CONVERTER_SVG)
468     set(IMAGE_CONVERTER_SVG ${IMAGE_CONVERTER_SVGZ})
469     endif(NOT IMAGE_CONVERTER_SVG)
470    
471     message(STATUS "SVG2PNG-Converter: ${IMAGE_CONVERTER_SVGZ}")
472     if (NOT IMAGE_CONVERTER_SVGZ)
473     message(WARNING "No SVG2PNG converter found. Please install one of the following tools: ${SVG_CONVERTER_PROGS}, or imagemagick with svg support")
474     set_with_reason(SVG2PNG "no converter found" FALSE)
475     endif(NOT IMAGE_CONVERTER_SVGZ)
476     endif(SVG2PNG)
477    
478     if (XPM2PNG)
479     message(STATUS "XPM2PNG-Converter: ${IMAGE_CONVERTER_XPM}")
480     if (NOT IMAGE_CONVERTER_XPM)
481     message(WARNING "No XPM2PNG converter found. Please install imagemagick with xpm support")
482     set_with_reason(XPM2PNG "no converter found" FALSE)
483     endif(NOT IMAGE_CONVERTER_XPM)
484     endif(XPM2PNG)
485    
486     set(XSLTS ${XSLTS} CACHE STRING "define a semicolon seperated list of XSLTs to process")
487    
488     # Plugins
489     if(USE_PLUGINS)
490     set(MODULE_BUILD_TYPE "MODULE")
491     add_definitions("-fPIC")
492     list(APPEND NAVIT_LIBS dl)
493     else()
494     set(MODULE_BUILD_TYPE "STATIC")
495     endif(USE_PLUGINS)
496     message(STATUS "Use plugins: ${MODULE_BUILD_TYPE}")
497    
498     if (SHARED_LIBNAVIT)
499     set(NAVIT_CORE_BUILD_TYPE "STATIC")
500     else(SHARED_LIBNAVIT)
501     set(NAVIT_CORE_BUILD_TYPE "SHARED")
502     endif(SHARED_LIBNAVIT)
503    
504     CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
505     CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
506     CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
507     CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
508     CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN)
509     CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC)
510     CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN)
511     CHECK_FUNCTION_EXISTS (popen HAVE_POPEN)
512     CHECK_FUNCTION_EXISTS (_atoi64 HAVE__ATOI64)
513    
514     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
515    
516     add_definitions("-Wall")
517     if (EXTRA_DEFINES)
518     add_definitions("${EXTRA_DEFINES}")
519     endif(EXTRA_DEFINES)
520    
521     if (NOT NAVIT_DEPENDENCY_ERROR)
522     message("\nSummary:\n")
523    
524     set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULES})
525     list(SORT SUMMARY_COMPONENTS)
526    
527     set(LAST_TYPE NONE)
528     foreach ( SUMMARY_COMP ${SUMMARY_COMPONENTS})
529     # split path to type and name
530     string(REPLACE "/" ";" SUMMARY_COMP_LIST ${SUMMARY_COMP})
531     list(GET SUMMARY_COMP_LIST 0 SUMMARY_COMP_TYPE)
532     list(LENGTH SUMMARY_COMP_LIST SUMMARY_COMP_LIST_LENGTH)
533     if ( SUMMARY_COMP_LIST_LENGTH GREATER 1 )
534     list(GET SUMMARY_COMP_LIST 1 SUMMARY_COMP_NAME)
535     else()
536     set(SUMMARY_COMP_NAME ${SUMMARY_COMP})
537     endif()
538     if ( NOT ${LAST_TYPE} STREQUAL ${SUMMARY_COMP_TYPE})
539     message("\n--->>> ${SUMMARY_COMP_TYPE}")
540     set(LAST_TYPE ${SUMMARY_COMP_TYPE})
541     endif()
542     if (${SUMMARY_COMP})
543     message("Enabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
544     else()
545     message("Disabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
546     endif()
547     endforeach()
548    
549     list(SORT ALL_FEATURES)
550     message("\n--->>> Features")
551     foreach ( FEATURE ${ALL_FEATURES})
552     if ( ${FEATURE} )
553     message("Enabled ${FEATURE} ( ${${FEATURE}_REASON} )")
554     else()
555     message("Disabled ${FEATURE} ( ${${FEATURE}_REASON} )")
556     endif()
557     endforeach()
558    
559     if (XSL_PROCESSING)
560     if (XSLTS)
561     message("\nProcessing XSLTS: ${XSLTS}")
562     else()
563     message("\nProcessing XSLTS: NONE")
564     endif(XSLTS)
565     endif(XSL_PROCESSING)
566    
567     message("\nTo configure your build use 'cmake -L' to find changeable variables and run cmake again with 'cmake -D <var-name>=<your value> ...'.")
568     endif(NOT NAVIT_DEPENDENCY_ERROR)
569    
570     add_subdirectory (navit)
571     add_subdirectory (man)
572    
573    
574     if (GETTEXT_FOUND)
575     add_subdirectory (po)
576     #install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale DESTINATION ${LOCALE_DIR})
577     endif(GETTEXT_FOUND)
578    
579    

   
Visit the ZANavi Wiki