ENDIF(NOT CMAKE_BUILD_TYPE)
### Detect environment
+
+add_plugin(support/glib "native Glib found" FALSE)
+add_plugin(support/zlib "native zlib found" FALSE)
+add_plugin(support/libpng "native libpng found" FALSE)
+add_plugin(support/wordexp "native wordexp found" FALSE)
+add_module(graphics/android "FreeType library not found" FALSE)
+add_module(graphics/gd "FreeType library not found" FALSE)
+add_module(graphics/gtk_drawing_area "FreeType library not found" FALSE)
+add_module(graphics/opengl "FreeType library not found" FALSE)
+add_module(graphics/sdl "FreeType library not found" FALSE)
+add_module(graphics/qt_qpainter "Qt libraries not found" FALSE)
+add_module(gui/qml "Qt Declarative not found" FALSE)
+add_module(gui/gtk "GTK libs not found" FALSE)
+add_module(vehicle/gpsd "gpsd lib not found" FALSE)
+add_module(vehicle/gypsy "gypsy lib not found" FALSE)
+add_module(binding/dbus "dbus-glib-1 not found" FALSE)
+add_module(speech/dbus "dbus-glib-1 not found" FALSE)
+add_module(vehicle/gpsd_dbus "dbus-glib-1 not found" FALSE)
+add_module(speech/speech_dispatcher "speech_dispatcher lib not found" FALSE)
+
INCLUDE (CPack)
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
include_directories(${Glib_INCLUDE_DIRS})
list(APPEND NAVIT_LIBS ${Glib_LIBRARIES})
else(Glib_FOUND)
- add_plugin(support/glib "Glib not found" TRUE)
+ set_with_reason(support/glib "Glib not found" TRUE)
endif(Glib_FOUND)
if(ZLIB_FOUND)
set(HAVE_ZLIB 1)
list(APPEND NAVIT_LIBS ${ZLIB_LIBRARIES})
else(ZLIB_FOUND)
message(STATUS "using internal zlib")
- add_plugin(support/zlib "native zlib missing" TRUE)
+ set_with_reason(support/zlib "native zlib missing" TRUE)
endif(ZLIB_FOUND)
if(PNG_FOUND)
set(HAVE_PNG 1)
list(APPEND NAVIT_LIBS ${PNG_LIBRARY})
else(PNG_FOUND)
message(STATUS "using internal libpng")
- add_plugin(support/libpng "native libpng missing" TRUE)
+ 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")
- add_plugin(support/wordexp "native wordexp missing" TRUE)
+ set_with_reason(support/wordexp "native wordexp missing" TRUE)
endif()
if(FREETYPE_FOUND)
#add_module(font/freetype "freetype found" TRUE)
else(FREETYPE_FOUND)
MESSAGE("No freetype library found, graphics modules may not be available")
- add_module(graphics/android "FreeType library not found" FALSE)
- add_module(graphics/gd "FreeType library not found" FALSE)
- add_module(graphics/gtk_drawing_area "FreeType library not found" FALSE)
- add_module(graphics/opengl "FreeType library not found" FALSE)
- add_module(graphics/sdl "FreeType library not found" FALSE)
+ 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)
endif(FREETYPE_FOUND)
if (QT_FOUND)
if (QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND FREETYPE_FOUND)
- add_module(graphics/qt_qpainter "Qt libraries found" TRUE)
+ set_with_reason(graphics/qt_qpainter "Qt libraries found" TRUE)
if (QT_QTDECLARATIVE_FOUND AND QT_QTXML_FOUND)
- add_module(gui/qml "Qt Declarative found" TRUE)
+ set_with_reason(gui/qml "Qt Declarative found" TRUE)
endif()
if (QT_QTSVG_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
list(APPEND NAVIT_LIBS ${GTK2_LIBRARIES})
set(HAVE_GTK2 1)
- add_module(gui/gtk "GTK libs found" TRUE)
+ set_with_reason(gui/gtk "GTK libs found" TRUE)
if(FREETYPE_FOUND)
- add_module(graphics/gtk_drawing_area "GTK libs found" TRUE)
+ set_with_reason(graphics/gtk_drawing_area "GTK libs found" TRUE)
endif(FREETYPE_FOUND)
endif(GTK2_FOUND)
if (OPENGL_FOUND AND OPENGL_GLU_FOUND AND OPENGL_INCLUDE_DIR)
message (STATUS "opengl found: ${OPENGL_gl_LIBRARY}")
include_directories(${OPENGL_INCLUDE_DIR})
- add_module(graphics/opengl "Found OpenGL and Quesoglc" TRUE)
+ set_with_reason(graphics/opengl "Found OpenGL and Quesoglc" TRUE)
else()
message (STATUS "opengl not found")
endif()
endif(QUESOGLC_FOUND AND FREETYPE_FOUND)
if(SDL_FOUND AND SDLIMAGE_FOUND AND FREE_TYPE_FOUND)
- add_module(graphics/sdl "SDL/SDL_image libs found" TRUE)
+ set_with_reason(graphics/sdl "SDL/SDL_image libs found" TRUE)
list(APPEND NAVIT_LIBS ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY})
set(SDL_IMAGE 1)
if(SDLTTF_FOUND)
endif(SDL_FOUND AND SDLIMAGE_FOUND AND FREE_TYPE_FOUND)
if (HAVE_LIBGPS)
- add_module(vehicle/gpsd "gpsd lib found" TRUE)
+ set_with_reason(vehicle/gpsd "gpsd lib found" TRUE)
endif(HAVE_LIBGPS)
if (GYPSY_FOUND)
- add_module(vehicle/gypsy "gypsy lib found" TRUE)
+ set_with_reason(vehicle/gypsy "gypsy lib found" TRUE)
endif(GYPSY_FOUND)
if(DBusGLib_FOUND)
include_directories(${DBusGLib_INCLUDE_DIRS})
list(APPEND NAVIT_LIBS ${DBusGLib_LIBRARIES})
- add_module(binding/dbus "dbus-glib-1 found" TRUE)
- add_module(speech/dbus "dbus-glib-1 found" TRUE)
- add_module(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE)
+ set_with_reason(binding/dbus "dbus-glib-1 found" TRUE)
+ set_with_reason(speech/dbus "dbus-glib-1 found" TRUE)
+ set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE)
endif()
if (HAVE_LIBSPEECHD)
- add_module(speech/speech_dispatcher "speech_dispatcher lib found" TRUE)
+ set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE)
endif(HAVE_LIBSPEECHD)
#Independent modules
foreach(PLUMO ${ALL_PLUGINS} ${ALL_MODULES} USE_PLUGINS USE_ROUTING BUILD_MAPTOOL USE_SVG SVG2PNG DBUS_USE_SYSTEM_BUS)
set(OLDVALUE ${${PLUMO}})
OPTION(${PLUMO} "Enable/Disable module/plugin/support" ${${PLUMO}})
- if ( NOT ${OLDVALUE} STREQUAL ${${PLUMO}} )
+ if ( (OLDVALUE AND NOT ${PLUMO}) OR (${PLUMO} AND NOT OLDVALUE))
set(${PLUMO}_REASON "User defined")
endif()
endforeach()