=== modified file 'CMakeLists.txt' --- CMakeLists.txt 2015-05-02 14:23:11 +0000 +++ CMakeLists.txt 2015-05-03 17:49:32 +0000 @@ -76,6 +76,7 @@ option(WITH_LIBCDR "Compile with support of libcdr for CorelDRAW Diagrams" ON) option(WITH_LIBVISIO "Compile with support of libvisio for Microsoft Visio Diagrams" ON) option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON) +option(WITH_NLS "Compile with Native Language Support (using gettext)" ON) include(CMakeScripts/ConfigPaths.cmake) # Installation Paths include(CMakeScripts/DefineDependsandFlags.cmake) # Includes, Compiler Flags, and Link Libraries @@ -122,6 +123,9 @@ # ----------------------------------------------------------------------------- add_subdirectory(src) +if(ENABLE_NLS) + add_subdirectory(po) +endif(ENABLE_NLS) # ----------------------------------------------------------------------------- === modified file 'CMakeScripts/ConfigChecks.cmake' --- CMakeScripts/ConfigChecks.cmake 2015-05-02 10:39:03 +0000 +++ CMakeScripts/ConfigChecks.cmake 2015-05-03 17:50:16 +0000 @@ -19,7 +19,6 @@ CHECK_INCLUDE_FILES(gc/gc.h HAVE_GC_GC_H) CHECK_INCLUDE_FILES(gc.h HAVE_GC_H) CHECK_INCLUDE_FILES(getopt.h HAVE_GETOPT_H) -CHECK_FUNCTION_EXISTS(gettext HAVE_GETTEXT) CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(gtk_window_fullscreen HAVE_GTK_WINDOW_FULLSCREEN) CHECK_FUNCTION_EXISTS(gtk_window_set_default_icon_from_file HAVE_GTK_WINDOW_SET_DEFAULT_ICON_FROM_FILE) === modified file 'CMakeScripts/ConfigPaths.cmake' --- CMakeScripts/ConfigPaths.cmake 2011-07-05 15:12:43 +0000 +++ CMakeScripts/ConfigPaths.cmake 2015-05-03 18:26:41 +0000 @@ -1,10 +1,12 @@ MESSAGE(STATUS "Creating build files in: ${CMAKE_CURRENT_BINARY_DIR}") +# this is the runtime place where to look for translations IF(WIN32) - SET(PACKAGE_LOCALE_DIR "locale") -ELSEIF(WIN32) - # TODO: check and change this to correct value: - SET(PACKAGE_LOCALE_DIR "locale") + SET(PACKAGE_LOCALE_DIR "locale") +ELSE(WIN32) + if(NOT PACKAGE_LOCALE_DIR) + SET(PACKAGE_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale") # packagers might overwrite this + endif(NOT PACKAGE_LOCALE_DIR) ENDIF(WIN32) #SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) === modified file 'CMakeScripts/DefineDependsandFlags.cmake' --- CMakeScripts/DefineDependsandFlags.cmake 2015-05-02 14:23:11 +0000 +++ CMakeScripts/DefineDependsandFlags.cmake 2015-05-03 18:27:12 +0000 @@ -336,6 +336,19 @@ endif() include(${CMAKE_CURRENT_LIST_DIR}/IncludeJava.cmake) + +set(ENABLE_NLS OFF) +if(WITH_NLS) + find_package(Gettext) + if(GETTEXT_FOUND) + message(STATUS "Found gettext + msgfmt to convert language files. Translation enabled") + set(ENABLE_NLS ON) + else(GETTEXT_FOUND) + message(STATUS "Cannot find gettext + msgfmt to convert language file. Translation won't be enabled") + endif(GETTEXT_FOUND) +endif(WITH_NLS) + + # end Dependencies