summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt28
-rw-r--r--config.h.cmake2
-rw-r--r--navit/CMakeLists.txt2
-rw-r--r--navit/intl_cmake/CMakeLists.txt2
4 files changed, 22 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eeab2ef1e..2f87c3352 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,6 +47,7 @@ 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)
+add_feature(ENABLE_NLS "default" TRUE)
INCLUDE (CPack)
INCLUDE (CheckIncludeFiles)
@@ -85,6 +86,8 @@ CHECK_INCLUDE_FILES(byteswap.h HAVE_BYTESWAP_H)
CHECK_LIBRARY_EXISTS(gypsy gypsy_control_get_default "" GYPSY_FOUND)
CHECK_INCLUDE_FILES(libspeechd.h HAVE_LIBSPEECHD)
CHECK_INCLUDE_FILES(sys/socket.h HAVE_SOCKET)
+CHECK_INCLUDE_FILES(locale.h HAVE_LC_MESSAGES)
+CHECK_INCLUDE_FILES(libintl.h HAVE_LIBINTL)
### Configure build
#Required libraries, supplied with navit
@@ -214,6 +217,21 @@ if (HAVE_LIBSPEECHD)
set_with_reason(speech/speech_dispatcher "speech_dispatcher lib found" TRUE speechd)
endif(HAVE_LIBSPEECHD)
+if (GETTEXT_FOUND)
+ execute_process(COMMAND echo "<test/>" COMMAND xgettext -L glade - RESULT_VARIABLE GETTEXT_RET)
+ if ("${GETTEXT_RET}" STREQUAL "0")
+ set(XGETTEXT_GLADE TRUE)
+ else()
+ set(XGETTEXT_GLADE FALSE)
+ endif()
+endif(GETTEXT_FOUND)
+
+if (NOT HAVE_LIBINTL)
+ add_plugin(intl_cmake "native libintl missing" TRUE)
+ set(USE_LIBGNUINTL TRUE)
+endif(NOT HAVE_LIBINTL)
+
+
#Independent modules
add_module(graphics/null "Default" TRUE)
add_module(osd/core "Default" TRUE)
@@ -299,10 +317,6 @@ if(WIN32 OR WINCE)
if(MSVC AND support/espeak)
add_definitions(-DPLATFORM_WINDOWS)
endif(MSVC AND support/espeak)
- set(ENABLE_NLS TRUE)
- add_plugin(intl_cmake "windows detected" TRUE)
- set(USE_LIBGNUINTL TRUE)
-
CHECK_LIBRARY_EXISTS(ws2_32 WSAStartup "" HAVE_WINSOCK)
if(HAVE_WINSOCK)
list(APPEND NAVIT_LIBS ws2_32)
@@ -478,12 +492,6 @@ add_subdirectory (navit)
add_subdirectory (man)
if (GETTEXT_FOUND)
- execute_process(COMMAND echo "<test/>" COMMAND xgettext -L glade - RESULT_VARIABLE GETTEXT_RET)
- if ("${GETTEXT_RET}" STREQUAL "0")
- set(XGETTEXT_GLADE TRUE)
- else()
- set(XGETTEXT_GLADE FALSE)
- endif()
add_subdirectory (po)
endif(GETTEXT_FOUND)
diff --git a/config.h.cmake b/config.h.cmake
index 65bff24a3..1c532408b 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -52,6 +52,8 @@
#cmakedefine HAVE_VALLOC 1
+#cmakedefine HAVE_LC_MESSAGES 1
+
#define HAVE_SYS_TIME_H 1
#define HAVE_GETOPT_H 1
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index f65f152ef..5a734b856 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -114,7 +114,7 @@ ADD_CUSTOM_COMMAND(
add_custom_target( navit_config_xml ALL DEPENDS navit.xml)
ADD_DEPENDENCIES(${NAVIT_LIBNAME} version)
-if (ENABLE_NLS)
+if (USE_LIBGNUINTL AND NOT HAVE_GLIB)
ADD_DEPENDENCIES(support_glib intl_cmake)
endif()
diff --git a/navit/intl_cmake/CMakeLists.txt b/navit/intl_cmake/CMakeLists.txt
index 231de22a4..d413a0be1 100644
--- a/navit/intl_cmake/CMakeLists.txt
+++ b/navit/intl_cmake/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_definitions(-DLOCALE_ALIAS_PATH=LOCALEDIR -DIN_LIBINTL=1 -DHAVE_CONFIG_H=1 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1)
+add_definitions(-DLOCALE_ALIAS_PATH=LOCALEDIR -DIN_LIBINTL=1 -DHAVE_CONFIG_H=1 -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DLIBDIR=\"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}\")
supportlib_add_library(intl_cmake bindtextdom.c dcgettext.c dcigettext.c dcngettext.c dgettext.c dngettext.c explodename.c finddomain.c gettext.c intl-compat.c l10nflist.c loadmsgcat.c localcharset.c localealias.c localename.c log.c ngettext.c osdep.c plural-exp.c plural.c printf-args.c printf.c relocatable.c textdomain.c vasnprintf.c)
ADD_CUSTOM_TARGET(libintl.h DEPENDS libgnuintl.h COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/libgnuintl.h ${CMAKE_CURRENT_BINARY_DIR}/libintl.h)
ADD_DEPENDENCIES(intl_cmake libintl.h)