/[zanavi_public1]/navit/CMakeLists.txt
ZANavi

Contents of /navit/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (hide annotations) (download)
Sun Mar 19 08:44:36 2017 UTC (5 years, 2 months ago) by zoff99
File MIME type: text/plain
File size: 28156 byte(s)
updates
1 zoff99 56
2    
3     # cmake command:
4     #U:\_Projekte\android\sdk\android-sdk-windows\cmake\3.6.3155560\bin\cmake.exe -HD:\_ready\git_repos\zanavi -BD:\_ready\git_repos\zanavi\navit\android\.externalNativeBuild\cmake\debug\armeabi "-GAndroid Gradle - Ninja" -DANDROID_ABI=armeabi -DANDROID_NDK=U:\_Projekte\android\sdk\android-sdk-windows\ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\_ready\git_repos\zanavi\navit\android\build\intermediates\cmake\debug\obj\armeabi -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=U:\_Projekte\android\sdk\android-sdk-windows\cmake\3.6.3155560\bin\ninja.exe -DCMAKE_TOOLCHAIN_FILE=U:\_Projekte\android\sdk\android-sdk-windows\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=9
5    
6     # compile command:
7     #cmd.exe /C "cd /D D:\_ready\git_repos\zanavi\navit\android\.externalNativeBuild\cmake\debug\mips64\navit && U:\_Projekte\android\sdk\android-sdk-windows\cmake\3.6.3155560\bin\cmake.exe -D SRC=D:/_ready/git_repos/zanavi/navit/version.h.in -D DST=D:/_ready/git_repos/zanavi/navit/android/.externalNativeBuild/cmake/debug/mips64/navit/version.h -D NAME="GIT_VERSION" -P D:/_ready/git_repos/zanavi/cmake/version.cmake"
8    
9    
10     message(STATUS "Building with CMake V${CMAKE_VERSION}")
11     project(zanavi C)
12    
13     set(CMAKE_VERBOSE_MAKEFILE TRUE)
14    
15    
16     # Workaround for CMake issue 8345 / 9220, see http://trac.navit-project.org/ticket/1041
17     if(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$")
18     set(CMAKE_CXX_COMPILER CMAKE_CXX_COMPILER-NOTFOUND)
19     endif(DEFINED CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER MATCHES "^$")
20     if (NOT DISABLE_CXX)
21     enable_language(CXX OPTIONAL)
22     endif(NOT DISABLE_CXX)
23    
24    
25     cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
26     set(NAVIT_VERSION_MAJOR "0")
27     set(NAVIT_VERSION_MINOR "5")
28     set(NAVIT_VERSION_PATCH "1")
29     set(PACKAGE_VERSION "${NAVIT_VERSION_MAJOR}.${NAVIT_VERSION_MINOR}.${NAVIT_VERSION_PATCH}")
30    
31     set(PACKAGE_NAME "zanavi-git")
32     set(PACKAGE "zanavi")
33     set(PACKAGE_STRING "${PACKAGE} ${PACKAGE_VERSION}")
34    
35     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
36     include("${PROJECT_SOURCE_DIR}/cmake/navit_macros.cmake")
37    
38     IF(NOT CMAKE_BUILD_TYPE)
39     SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
40     ENDIF(NOT CMAKE_BUILD_TYPE)
41    
42     # install path
43     set(BIN_DIR bin)
44     set(SHARE_DIR share/navit)
45     set(LOCALE_DIR share/locale)
46     set(IMAGE_DIR share/navit/xpm)
47     set(MAN_DIR share/man/man1)
48     # LIB_DIR
49     IF(UNIX AND NOT ANDROID AND NOT APPLE)
50     IF (NOT LIBDIR)
51     MESSAGE(STATUS "LIBDIR variable is not defined. It will be autodetected now.")
52     MESSAGE(STATUS "You can set it manually with -DLIBDIR=<value>")
53     # check 64 bit
54     IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
55     SET(LIB_DIR lib)
56     MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
57     ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4)
58     SET(LIB_DIR lib64)
59     MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
60     ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
61     ELSE (NOT LIBDIR)
62     GET_FILENAME_COMPONENT (LIB_DIR ${LIBDIR} NAME)
63     MESSAGE(STATUS " LIB_DIR (highest subdirectory if LIBDIR) is set to '${LIB_DIR}'")
64     ENDIF (NOT LIBDIR)
65     ELSE (UNIX AND NOT ANDROID AND NOT APPLE)
66     SET(LIB_DIR lib)
67     ENDIF (UNIX AND NOT ANDROID AND NOT APPLE)
68    
69     foreach(EXTRA_MODULE ${EXTRA_MODULES})
70     add_module(${EXTRA_MODULE} "extra module specified" TRUE)
71     endforeach()
72    
73     if (EXTRA_LIBS)
74     list(APPEND NAVIT_LIBS ${EXTRA_LIBS})
75     endif(EXTRA_LIBS)
76    
77     if (EXTRA_INCLUDES)
78     include_directories(${EXTRA_INCLUDES})
79     endif(EXTRA_INCLUDES)
80    
81     if (EXTRA_LIBDIR)
82     link_directories(${EXTRA_LIBDIR})
83     endif(EXTRA_LIBDIR)
84    
85     ### Detect environment
86    
87     add_plugin(support/ezxml "native Glib found" FALSE)
88     add_plugin(support/glib "native Glib found" FALSE)
89     add_plugin(support/zlib "native zlib found" FALSE)
90     #add_plugin(support/libpng "native libpng found" FALSE)
91     add_plugin(support/wordexp "native wordexp found" FALSE)
92     #add_plugin(../intl "native libintl found" FALSE)
93     #add_subdirectory (./intl ./intl)
94     add_module(font/freetype "freetype not found" FALSE)
95     add_module(graphics/android "FreeType library not found" FALSE)
96     add_module(graphics/gd "FreeType library not found" FALSE)
97     add_module(graphics/gtk_drawing_area "FreeType library not found" FALSE)
98     add_module(graphics/opengl "FreeType library not found" FALSE)
99     add_module(graphics/sdl "Required library not found" FALSE)
100     add_module(graphics/egl "Required library not found" FALSE)
101     add_module(graphics/qt_qpainter "Qt libraries not found" FALSE)
102     add_module(graphics/qt5 "Qt5 libraries not found" FALSE)
103     add_module(gui/qml "Qt Declarative not found" FALSE)
104     add_module(gui/gtk "GTK libs not found" FALSE)
105     add_module(vehicle/gpsd "gpsd lib not found" FALSE)
106     add_module(vehicle/gypsy "gypsy lib not found" FALSE)
107     add_module(vehicle/maemo "Default" FALSE)
108     add_module(binding/win32 "Default" FALSE)
109     add_module(binding/dbus "dbus-glib-1 not found" FALSE)
110     add_module(binding/python "python libraries not found" FALSE)
111     add_module(speech/dbus "dbus-glib-1 not found" FALSE)
112     # add_module(speech/cmdline "neither system() nor CreateProcess() found" FALSE)
113     add_module(speech/cmdline "disabled" FALSE)
114     add_module(vehicle/gpsd_dbus "dbus-glib-1 not found" FALSE)
115     add_module(vehicle/qt5 "Qt5 libraries not found" FALSE)
116     add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
117     add_module(autoload/osso "Default" FALSE)
118     add_module(map/garmin "Garmin library not found" FALSE)
119     add_feature(USE_NATIVE_LANGUAGE_SUPPORT "Gettext not found and not on Windows" FALSE)
120     set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/cpack.cmake")
121     set(CPACK_PACKAGE_VENDOR "Navit team")
122     set(CPACK_PACKAGE_VERSION_MAJOR ${NAVIT_VERSION_MAJOR})
123     set(CPACK_PACKAGE_VERSION_MINOR ${NAVIT_VERSION_MINOR})
124     set(CPACK_PACKAGE_VERSION_PATCH "${NAVIT_VERSION_PATCH}")
125     set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
126     set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/GPL-2")
127     set(CPACK_NSIS_PACKAGE_NAME "Navit ${PACKAGE_VERSION}")
128     set(CPACK_PACKAGE_FILE_NAME ${PACKAGE})
129     set(CPACK_PACKAGE_EXECUTABLES "navit;Navit")
130     set(CPACK_NSIS_HELP_LINK "http://www.navit-project.org/?page=contact")
131     set(CPACK_NSIS_URL_INFO_ABOUT "http://www.navit-project.org")
132     if(WIN32)
133     add_feature(USE_NSIS "makensis not found" FALSE)
134     FIND_PROGRAM(NSIS_EXECUTABLE NAMES makensis makensis.exe)
135     if(NSIS_EXECUTABLE)
136     set_with_reason(USE_NSIS "makensis found" TRUE)
137     endif(NSIS_EXECUTABLE)
138    
139     set(CPACK_GENERATOR ZIP)
140     if(USE_NSIS)
141     list(APPEND CPACK_GENERATOR NSIS)
142     endif(USE_NSIS)
143     set(CPACK_PACKAGE_INSTALL_DIRECTORY Navit)
144     endif(WIN32)
145     INCLUDE (CPack)
146    
147     INCLUDE (CheckIncludeFiles)
148     INCLUDE (CheckLibraryExists)
149     INCLUDE (CheckFunctionExists)
150     INCLUDE (CheckSymbolExists)
151     find_package(Glib)
152     find_package(Gmodule)
153     find_package(ZLIB)
154     find_package(Freetype)
155     find_library(SDL2MAIN SDL2)
156     find_library(SDL2IMAGE SDL2_image)
157     find_library(GLES2 GLESv2)
158     find_package(SDL)
159     find_package(SDL_ttf)
160     find_package(SDL_image)
161     find_package(OpenGL)
162     find_package(GLUT)
163     find_package(GTK2 2.6 COMPONENTS gtk)
164     find_package(Gettext)
165     find_package(PNG)
166     find_package(DBusGLib)
167     find_package(PythonLibs)
168     find_package(OpenSSL)
169     find_package(Threads)
170     libfind_pkg_check_modules(FONTCONFIG fontconfig)
171    
172     #pkg-config based detection
173     find_package(PkgConfig)
174    
175     #Simple checks
176     CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP)
177     CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
178     CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
179     CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
180     CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
181     CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
182     CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
183     CHECK_INCLUDE_FILES(sys/shm.h HAVE_SHMEM)
184     CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
185     if (NOT HAVE_SNPRINTF)
186     CHECK_FUNCTION_EXISTS(_snprintf HAVE_DECL__SNPRINTF)
187     if (HAVE_DECL__SNPRINTF)
188     set(HAVE_SNPRINTF 1)
189     endif(HAVE_DECL__SNPRINTF)
190     endif(NOT HAVE_SNPRINTF)
191     CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES)
192     #CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL)
193     CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
194     CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H)
195     CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
196     CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
197     CHECK_SYMBOL_EXISTS(system stdlib.h HAVE_SYSTEM)
198     CHECK_SYMBOL_EXISTS(CreateProcess windows.h HAVE_CREATEPROCESS)
199     CHECK_SYMBOL_EXISTS(stpcpy string.h HAVE_STPCPY)
200     CHECK_FUNCTION_EXISTS(sbrk HAVE_SBRK)
201     CHECK_FUNCTION_EXISTS(getdelim HAVE_GETDELIM)
202     CHECK_FUNCTION_EXISTS(getline HAVE_GETLINE)
203     CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
204    
205    
206     ### Configure build
207    
208     if (Glib_FOUND)
209     set(HAVE_GLIB 1)
210     include_directories(${Glib_INCLUDE_DIRS})
211     list(APPEND NAVIT_LIBS ${Glib_LIBRARIES})
212     else(Glib_FOUND)
213     set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS})
214     endif(Glib_FOUND)
215     if (Gmodule_FOUND)
216     set(HAVE_GMODULE 1)
217     include_directories(${Gmodule_INCLUDE_DIRS})
218     list(APPEND NAVIT_LIBS ${Gmodule_LIBRARIES})
219     endif(Gmodule_FOUND)
220     if(ZLIB_FOUND)
221     set(HAVE_ZLIB 1)
222     include_directories(${ZLIB_INCLUDE_DIRS})
223     list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES})
224     else(ZLIB_FOUND)
225     message(STATUS "using internal zlib")
226     set_with_reason(support/zlib "native zlib missing" TRUE)
227     endif(ZLIB_FOUND)
228     if(OPENSSL_CRYPTO_LIBRARIES)
229     set(HAVE_LIBCRYPTO 1)
230     include_directories(${OPENSSL_INCLUDE_DIR})
231     list(APPEND NAVIT_LIBS ${OPENSSL_CRYPTO_LIBRARIES})
232     endif()
233     if(PNG_FOUND)
234     set(HAVE_PNG 1)
235     include_directories(${PNG_INCLUDE_DIR})
236     list(APPEND NAVIT_LIBS ${PNG_LIBRARIES})
237     else(PNG_FOUND)
238     message(STATUS "using internal libpng")
239     #set_with_reason(support/libpng "native libpng missing" TRUE)
240     endif(PNG_FOUND)
241     if (NOT HAVE_WORDEXP)
242     message(STATUS "wordexp.h not found. use internal wordexp")
243     set_with_reason(support/wordexp "native wordexp missing" TRUE)
244     endif()
245     if (NOT Glib_FOUND)
246     set_with_reason(support/ezxml "Glib not found" TRUE)
247     endif()
248    
249     if(FREETYPE_FOUND)
250     pkg_check_modules(FRIBIDI fribidi)
251     pkg_check_modules(FRIBIDI2 fribidi>=0.19.0)
252     include_directories(${FREETYPE_INCLUDE_DIRS})
253     set_with_reason(font/freetype "freetype found" TRUE "${FREETYPE_LIBRARY};${FONTCONFIG_LDFLAGS};${FRIBIDI_LIBRARIES}")
254     else(FREETYPE_FOUND)
255     MESSAGE("No freetype library found, graphics modules may not be available")
256     set_with_reason(graphics/android "FreeType library not found" FALSE)
257     set_with_reason(graphics/gd "FreeType library not found" FALSE)
258     set_with_reason(graphics/gtk_drawing_area "FreeType library not found" FALSE)
259     set_with_reason(graphics/opengl "FreeType library not found" FALSE)
260     set_with_reason(graphics/sdl "FreeType library not found" FALSE)
261     set_with_reason(graphics/egl "FreeType library not found" FALSE)
262     endif(FREETYPE_FOUND)
263    
264     if(FONTCONFIG_FOUND)
265     set(HAVE_FONTCONFIG 1)
266     endif(FONTCONFIG_FOUND)
267    
268    
269    
270     CHECK_LIBRARY_EXISTS(freeimage FreeImage_Load "" HAVE_FREEIMAGE)
271    
272     if (GETTEXT_FOUND)
273     set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Gettext found" TRUE)
274     endif(GETTEXT_FOUND)
275    
276     #Independent modules
277     #add_module(graphics/null "Default" FALSE)
278     add_module(osd/core "Default" TRUE)
279     add_module(vehicle/demo "Default" TRUE)
280     add_module(vehicle/file "Default" FALSE)
281     #add_module(vehicle/null "Default" FALSE)
282     add_module(gui/internal "Default" TRUE)
283     add_module(map/binfile "Default" TRUE)
284     #add_module(map/filter "Default" FALSE)
285     #if(NOT MSVC)
286     #add_module(map/mg "Default" FALSE)
287     #endif(NOT MSVC)
288     add_module_plugin(support/shapefile "Default" FALSE)
289     set(map_shapefile_INCLUDES "${CMAKE_SOURCE_DIR}/navit/support/shapefile")
290     #set(map_shapefile_LIBRARY_DIRS "${CMAKE_BINARY_DIR}/navit/support/shapefile")
291     set(map_shapefile_LIBS "support_shapefile")
292     add_module(map/shapefile "Default" FALSE)
293     add_module(map/textfile "Default" TRUE)
294     add_module(map/csv "Default" TRUE)
295    
296     #Modules without test yet
297     add_module(plugin/pedestrian "Default" FALSE)
298     add_module(plugin/j1850 "Default" FALSE)
299     add_module(speech/android "Default" FALSE)
300     add_module(speech/espeak "Default" FALSE)
301     add_module(speech/iphone "Default" FALSE)
302     add_plugin(support/espeak "Default" FALSE)
303     add_module(vehicle/android "Default" FALSE)
304     add_module(vehicle/iphone "Default" FALSE)
305     add_module(vehicle/wince "Default" FALSE)
306     add_module(graphics/cocoa "Default" FALSE)
307    
308     # other features
309     add_feature(USE_PLUGINS "default" TRUE)
310     add_feature(USE_ROUTING "default" TRUE)
311     add_feature(USE_SVG "default" TRUE)
312     add_feature(SVG2PNG "default" TRUE)
313     add_feature(SAMPLE_MAP "default" FALSE)
314    
315     IF(NOT svg2png_scaling)
316     IF(NOT ANDROID)
317     set(svg2png_scaling 0 16 32 48 64 96)
318     ELSE()
319     set(svg2png_scaling -1 24 32 48 64 96 128)
320     ENDIF()
321     ENDIF()
322     IF(NOT svg2png_scaling_flag)
323     IF(NOT ANDROID)
324     set(svg2png_scaling_flag 32)
325     ELSE()
326     set(svg2png_scaling_flag -1 24 32 64 96)
327     ENDIF()
328     ENDIF()
329     IF(NOT svg2png_scaling_nav)
330     IF(NOT ANDROID)
331     set(svg2png_scaling_nav 64)
332     ELSE()
333     set(svg2png_scaling_nav -1 24 32 48 64 96 128)
334     ENDIF()
335     ENDIF()
336    
337     add_feature(DBUS_USE_SYSTEM_BUS "default" FALSE)
338     add_feature(BUILD_MAPTOOL "default" TRUE)
339     add_feature(XSL_PROCESSING "default" FALSE)
340    
341     set(SUPPORTED_XSLT_PROCESSORS "saxonb-xslt;saxon;saxon8;saxon-xslt;xsltproc;transform.exe")
342     find_program(XSLT_PROCESSOR NAMES ${SUPPORTED_XSLT_PROCESSORS})
343     if(XSLT_PROCESSOR)
344     message(STATUS "Found XSLT processor: ${XSLT_PROCESSOR}")
345     execute_process(COMMAND ${XSLT_PROCESSOR} -snone ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xml ${CMAKE_CURRENT_SOURCE_DIR}/cmake/test.xslt
346     RESULT_VARIABLE SAXON_ERROR OUTPUT_QUIET ERROR_QUIET)
347     if (NOT SAXON_ERROR)
348     set (XSLT_PROCESSOR_OPTIONS -snone)
349     endif()
350     # additional parameter is passed to the stylesheet processor as transformation parameter
351     macro(compose_xslt_transform_command CMDVAR XSLT_FILE SRC_XML DEST_XML)
352     if(${XSLT_PROCESSOR} MATCHES "xsltproc")
353     set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${XSLT_FILE} ${SRC_XML} >${DEST_XML})
354     else()
355     set(${CMDVAR} COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_OPTIONS} ${SRC_XML} ${XSLT_FILE} ${ARGN} >${DEST_XML})
356     endif()
357     endmacro()
358     else()
359     cfg_feature(XSL_PROCESSING "Saxon missing" FALSE)
360     endif(XSLT_PROCESSOR)
361    
362     if (NOT XSL_PROCESSING)
363     message(WARNING "No XSLT processor available. You have to configure "
364     "navit.xml yourself, or install an XSLT processor (supported: "
365     "${SUPPORTED_XSLT_PROCESSORS}).")
366     endif()
367    
368     ### Platform specific settings
369     if(NOT CACHE_SIZE)
370     SET(CACHE_SIZE 1048576)
371     endif(NOT CACHE_SIZE)
372    
373     if(WIN32 OR WINCE)
374     SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
375     add_module(graphics/win32 "Windows detected" TRUE)
376     add_plugin(support/win32 "Windows detected" TRUE)
377    
378     SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I ${CMAKE_CURRENT_SOURCE_DIR}/navit/gui/win32/resources <DEFINES> -i <SOURCE> -o <OBJECT>")
379     set_with_reason(support/ezxml "Windows detected" TRUE)
380     set_with_reason(speech/espeak "Windows detected" TRUE)
381     set_with_reason(support/espeak "Windows detected" TRUE)
382     set_with_reason(binding/win32 "Windows detected" TRUE)
383    
384     # vehicle_file is broken for windows. use vehicle_wince instead
385     # whicle_wince isn't buildable on non-CE windows ssytems
386    
387     # plugins currently not supported on windows
388     set_with_reason(USE_PLUGINS "win32: currently not supported" FALSE)
389    
390     set(HAVE_API_WIN32_BASE 1)
391     set(EZXML_NOMMAP 1)
392    
393     # Image stuff
394     if(NOT graphics/qt_qpainter)
395     set_with_reason(USE_SVG "win32: SVGs currently not supported" FALSE)
396     else(NOT graphics/qt_qpainter)
397     MESSAGE(STATUS "win32: SVGs may not be supported by every available graphics")
398     endif(NOT graphics/qt_qpainter)
399    
400     set(BIN_DIR bin)
401     set(SHARE_DIR ./)
402     set(LOCALE_DIR locale)
403     set(IMAGE_DIR xpm)
404    
405    
406     if(HAVE_GTK2 AND NOT MSVC)
407     #GTK requires special compile flags
408     add_definitions("-mms-bitfields")
409     endif(HAVE_GTK2 AND NOT MSVC)
410     if(MSVC AND support/espeak)
411     add_definitions(-DPLATFORM_WINDOWS)
412     endif(MSVC AND support/espeak)
413     CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK)
414     if(HAVE_WINSOCK)
415     list(APPEND NAVIT_LIBS ws2_32)
416     else()
417     CHECK_LIBRARY_EXISTS(ws2 WSAStartup "" HAVE_WINSOCK_2)
418     if(HAVE_WINSOCK_2)
419     set(HAVE_WINSOCK 1)
420     list(APPEND NAVIT_LIBS ws2)
421     endif()
422     endif(HAVE_WINSOCK)
423    
424     if(MSVC)
425     set(HAVE_PRAGMA_PACK 1)
426     add_plugin(support/xgetopt "Windows detected" TRUE)
427     endif(MSVC)
428     set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Windows detected" TRUE)
429     enable_language(RC)
430    
431     set(XSLTS "windows;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process")
432     endif()
433     if (WIN32 AND NOT WINCE)
434     set(HAVE_API_WIN32 1)
435     set(HAVE_STDINT_H 1)
436     list(APPEND NAVIT_LIBS winmm)
437     endif()
438     if(WINCE)
439     add_plugin(support/libc "wince detected" TRUE)
440     set(HAVE_API_WIN32_CE 1)
441     set(BUILD_MAPTOOL FALSE)
442     # mingw32ce since gcc 4.7.0 needs HAVE_PRAGMA_PACK as __attribute__((packed)) is broken, see gcc bug 52991
443     set(HAVE_PRAGMA_PACK 1)
444     set_with_reason(vehicle/file "wince: currently broken" FALSE)
445     set_with_reason(vehicle/wince "wince detected" TRUE)
446     endif()
447    
448     if(CMAKE_SIZEOF_VOID_P LESS 8)
449     set_with_reason(BUILD_MAPTOOL "maptool works only on 64 bit architectures" FALSE)
450     endif()
451    
452     set(LOCALEDIR "${LOCALE_DIR}/locale")
453    
454     find_program(BZCAT NAMES bzcat)
455     if (SAMPLE_MAP)
456     if(CMAKE_CROSSCOMPILING)
457     cfg_feature(SAMPLE_MAP "downloading binary map because of cross compiling" TRUE)
458     set(DOWNLOAD_SAMPLE_MAP TRUE)
459     elseif(NOT BZCAT)
460     cfg_feature(SAMPLE_MAP "downloading binary map because of missing bzcat" TRUE)
461     set(DOWNLOAD_SAMPLE_MAP TRUE)
462     elseif(NOT BUILD_MAPTOOL)
463     cfg_feature(SAMPLE_MAP "downloading binary map because maptool compilation is disabled" TRUE)
464     set(DOWNLOAD_SAMPLE_MAP TRUE)
465     endif(CMAKE_CROSSCOMPILING)
466     endif(SAMPLE_MAP)
467    
468     if(ANDROID)
469     list(APPEND NAVIT_LIBS log)
470     set(HAVE_API_ANDROID 1)
471     set_with_reason(graphics/android "Android detected" TRUE)
472     set_with_reason(speech/android "Android detected" TRUE)
473     set_with_reason(vehicle/android "Android detected" TRUE)
474     set(SHARED_LIBNAVIT TRUE)
475    
476     add_feature(XPM2PNG "Android detected" TRUE)
477     set(NAVIT_COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS} -fPIC")
478     endif(ANDROID)
479    
480     # Image conversion
481     find_program(IMAGE_CONVERTER NAMES convert)
482     execute_process(COMMAND ${IMAGE_CONVERTER} -list format OUTPUT_VARIABLE CONVERT_FORMATS)
483     if(CONVERT_FORMATS MATCHES ".*XPM[ *][ ]*XPM[ ]*r[w-].*")
484     set(IMAGE_CONVERTER_XPM ${IMAGE_CONVERTER})
485     endif()
486    
487     set(CMAKE_APPBUNDLE_PATH "")
488     if (SVG2PNG)
489     if (NOT IMAGE_CONVERTER_SVGZ)
490     set (SVG_CONVERTER_PROGS rsvg-convert ksvgtopng ksvgtopng4 inkscape)
491     set (CMAKE_FIND_APPBUNDLE "NEVER")
492     find_program(IMAGE_CONVERTER_SVGZ NAMES ${SVG_CONVERTER_PROGS} PATHS /Applications/Inkscape.app/Contents/Resources/bin)
493     if (NOT IMAGE_CONVERTER_SVGZ)
494     if(CONVERT_FORMATS MATCHES ".*[ ]*SVG[ ]*r[w-].*")
495     set(IMAGE_CONVERTER_SVGZ ${IMAGE_CONVERTER})
496     endif()
497     endif()
498     endif(NOT IMAGE_CONVERTER_SVGZ)
499     if (NOT IMAGE_CONVERTER_SVG)
500     set(IMAGE_CONVERTER_SVG ${IMAGE_CONVERTER_SVGZ})
501     endif(NOT IMAGE_CONVERTER_SVG)
502    
503     message(STATUS "SVG2PNG-Converter: ${IMAGE_CONVERTER_SVGZ}")
504     if (NOT IMAGE_CONVERTER_SVGZ)
505     message(WARNING "No SVG2PNG converter found. Please install one of the following tools: ${SVG_CONVERTER_PROGS}, or imagemagick with svg support")
506     set_with_reason(SVG2PNG "no converter found" FALSE)
507     endif(NOT IMAGE_CONVERTER_SVGZ)
508     endif(SVG2PNG)
509    
510     if (XPM2PNG)
511     message(STATUS "XPM2PNG-Converter: ${IMAGE_CONVERTER_XPM}")
512     if (NOT IMAGE_CONVERTER_XPM)
513     message(WARNING "No XPM2PNG converter found. Please install imagemagick with xpm support")
514     set_with_reason(XPM2PNG "no converter found" FALSE)
515     endif(NOT IMAGE_CONVERTER_XPM)
516     endif(XPM2PNG)
517    
518     set(XSLTS ${XSLTS} CACHE STRING "define a semicolon seperated list of XSLTs to process")
519    
520     # Plugins
521     if(USE_PLUGINS)
522     set(MODULE_BUILD_TYPE "MODULE")
523     add_definitions("-fPIC")
524     list(APPEND NAVIT_LIBS dl)
525     else()
526     set(MODULE_BUILD_TYPE "STATIC")
527     endif(USE_PLUGINS)
528     message(STATUS "Use plugins: ${MODULE_BUILD_TYPE}")
529    
530     CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
531     CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
532     CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
533     CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
534     CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN)
535     CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC)
536     CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN)
537     CHECK_FUNCTION_EXISTS (popen HAVE_POPEN)
538     CHECK_FUNCTION_EXISTS (_atoi64 HAVE__ATOI64)
539    
540     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
541    
542     # Compile with -Wall -Wextra. We need all the help we can get from the compiler :-).
543     # Disabled warnings:
544     # -Wno-missing-field-initializers: Used a lot, does not seem problematic.
545     # -Wno-unused-parameter: Unfortunately occurs frequently because of
546     # functions implementing the interface of a plugin.
547     # -Wno-sign-compare: We currently just use int almost everywhere.
548     # Unclear if it's really worth correcting.
549     if(CMAKE_COMPILER_IS_GNUCC OR CCMAKE_COMPILER_IS_GNUCXX)
550     set(COMMON_COMPILER_FLAGS "-Wall -Wundef -Wcast-align -Wpointer-arith -Wno-unused-parameter -Wno-sign-compare")
551     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}")
552     set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${COMMON_COMPILER_FLAGS}")
553     # flags not available in old GCC versions, or not for both C and C++
554     #add_compiler_flag_if_available("-Wno-missing-field-initializers")
555     #add_compiler_flag_if_available("-Wextra")
556     # -Wreturn-type
557     #add_compiler_flag_if_available("-Wmissing-prototypes")
558     #add_compiler_flag_if_available("-Wstrict-prototypes ")
559    
560     # ---------------------------
561     MESSAGE( STATUS "0 CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
562     MESSAGE( STATUS "0 CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
563     MESSAGE( STATUS "0 CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
564     MESSAGE( STATUS "0 CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
565     MESSAGE( STATUS "0 COMMON_COMPILER_FLAGS: " ${COMMON_COMPILER_FLAGS} )
566     # ---------------------------
567    
568    
569     #remove_compiler_flag("-Wall")
570     #remove_compiler_flag("-Werror")
571     #remove_compiler_flag("-Wreturn-type")
572    
573     string (REPLACE "-Wall" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
574     #string (REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
575     string (REPLACE "-Wreturn-type" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
576    
577     string (REPLACE "-Wall" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
578     #string (REPLACE "-Werror" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
579     string (REPLACE "-Wreturn-type" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
580    
581     string (REPLACE "-Wall" "" COMMON_COMPILER_FLAGS ${COMMON_COMPILER_FLAGS})
582     #string (REPLACE "-Werror" "" COMMON_COMPILER_FLAGS ${COMMON_COMPILER_FLAGS})
583     string (REPLACE "-Wreturn-type" "" COMMON_COMPILER_FLAGS ${COMMON_COMPILER_FLAGS})
584    
585     endif()
586    
587    
588     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lgcc -ljnigraphics -lm")
589     set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -lgcc -ljnigraphics -lm")
590    
591    
592     if (EXTRA_DEFINES)
593     add_definitions("${EXTRA_DEFINES}")
594     endif(EXTRA_DEFINES)
595    
596     remove_definitions(-Werror)
597     remove_definitions(-Wreturn-type)
598    
599     # ---------------------------
600     MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
601     MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
602     MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_C_FLAGS} )
603     MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_FLAGS} )
604     MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${COMMON_COMPILER_FLAGS} )
605     # ---------------------------
606    
607    
608     # ---------------------------
609     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS: " ${ANDROID_COMPILER_FLAGS} )
610     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_CXX: " ${ANDROID_COMPILER_FLAGS_CXX} )
611     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_DEBUG: " ${ANDROID_COMPILER_FLAGS_DEBUG} )
612     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_RELEASE: " ${ANDROID_COMPILER_FLAGS_RELEASE} )
613     # ---------------------------
614    
615     #string(REPLACE "-Werror" "" ANDROID_COMPILER_FLAGS "${ANDROID_COMPILER_FLAGS}")
616     #string(REPLACE "-Werror" "" ANDROID_COMPILER_FLAGS_CXX "${ANDROID_COMPILER_FLAGS_CXX}")
617     #string(REPLACE "-Werror" "" ANDROID_COMPILER_FLAGS_DEBUG "${ANDROID_COMPILER_FLAGS_DEBUG}")
618     #string(REPLACE "-Werror" "" ANDROID_COMPILER_FLAGS_RELEASE "${ANDROID_COMPILER_FLAGS_RELEASE}")
619    
620     # ---------------------------
621     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS: " ${ANDROID_COMPILER_FLAGS} )
622     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_CXX: " ${ANDROID_COMPILER_FLAGS_CXX} )
623     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_DEBUG: " ${ANDROID_COMPILER_FLAGS_DEBUG} )
624     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_RELEASE: " ${ANDROID_COMPILER_FLAGS_RELEASE} )
625     # ---------------------------
626    
627    
628    
629    
630     if (NOT NAVIT_DEPENDENCY_ERROR)
631     message("\nSummary:\n")
632    
633     set(SUMMARY_COMPONENTS ${ALL_PLUGINS} ${ALL_MODULE_PLUGINS} ${ALL_MODULES})
634     list(SORT SUMMARY_COMPONENTS)
635    
636     set(LAST_TYPE NONE)
637     foreach ( SUMMARY_COMP ${SUMMARY_COMPONENTS})
638     # split path to type and name
639     string(REPLACE "/" ";" SUMMARY_COMP_LIST ${SUMMARY_COMP})
640     list(GET SUMMARY_COMP_LIST 0 SUMMARY_COMP_TYPE)
641     list(LENGTH SUMMARY_COMP_LIST SUMMARY_COMP_LIST_LENGTH)
642     if ( SUMMARY_COMP_LIST_LENGTH GREATER 1 )
643     list(GET SUMMARY_COMP_LIST 1 SUMMARY_COMP_NAME)
644     else()
645     set(SUMMARY_COMP_NAME ${SUMMARY_COMP})
646     endif()
647     if ( NOT ${LAST_TYPE} STREQUAL ${SUMMARY_COMP_TYPE})
648     message("\n--->>> ${SUMMARY_COMP_TYPE}")
649     set(LAST_TYPE ${SUMMARY_COMP_TYPE})
650     endif()
651     if (${SUMMARY_COMP})
652     message("Enabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
653     else()
654     message("Disabled ${SUMMARY_COMP_NAME} ( ${${SUMMARY_COMP}_REASON} )")
655     endif()
656     endforeach()
657    
658     list(SORT ALL_FEATURES)
659     message("\n--->>> Features")
660     foreach ( FEATURE ${ALL_FEATURES})
661     if ( ${FEATURE} )
662     message("Enabled ${FEATURE} ( ${${FEATURE}_REASON} )")
663     else()
664     message("Disabled ${FEATURE} ( ${${FEATURE}_REASON} )")
665     endif()
666     endforeach()
667    
668     if (XSL_PROCESSING)
669     if (XSLTS)
670     message("\nProcessing XSLT files: ${XSLTS}")
671     else()
672     message("\nProcessing XSLT files: NONE")
673     endif(XSLTS)
674     message("See navit/xslt for available XSLT files, and put them into "
675     "cache variable 'XSLTS' (without extension .xslt).")
676     endif(XSL_PROCESSING)
677    
678     message("\nTo configure your build use 'cmake -L' to find changeable variables and run cmake again with 'cmake -D <var-name>=<your value> ...'.")
679     endif(NOT NAVIT_DEPENDENCY_ERROR)
680    
681    
682    
683     # ---------------------------
684     MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
685     MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
686     MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
687     MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
688     MESSAGE( STATUS "COMMON_COMPILER_FLAGS: " ${COMMON_COMPILER_FLAGS} )
689     # ---------------------------
690    
691    
692     # ---------------------------
693     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS: " ${ANDROID_COMPILER_FLAGS} )
694     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_CXX: " ${ANDROID_COMPILER_FLAGS_CXX} )
695     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_DEBUG: " ${ANDROID_COMPILER_FLAGS_DEBUG} )
696     MESSAGE( STATUS "ANDROID_COMPILER_FLAGS_RELEASE: " ${ANDROID_COMPILER_FLAGS_RELEASE} )
697    
698     MESSAGE( STATUS "CMAKE_C_FLAGS_DEBUG: " ${CMAKE_C_FLAGS_DEBUG} )
699     MESSAGE( STATUS "CMAKE_CXX_FLAGS_DEBUG: " ${CMAKE_CXX_FLAGS_DEBUG} )
700     # ---------------------------
701    
702     add_subdirectory (navit)
703    
704    

   
Visit the ZANavi Wiki