mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 07:53:31 +01:00
Merge pull request #202 from vgough/gettext
update nls install, fixes #198
This commit is contained in:
commit
0d99703983
@ -15,7 +15,8 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
|||||||
"${CMAKE_SOURCE_DIR}/cmake")
|
"${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
option (BUILD_SHARED_LIBS "build shared libraries" OFF)
|
option (BUILD_SHARED_LIBS "build shared libraries" OFF)
|
||||||
option (USE_INTERNAL_TINYXML "use build-in TinyXML2" ON)
|
option (USE_INTERNAL_TINYXML "use built-in TinyXML2" ON)
|
||||||
|
option (ENABLE_NLS "Compile with Native Language Support (using gettext)" ON)
|
||||||
|
|
||||||
# We need C++ 11
|
# We need C++ 11
|
||||||
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
|
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
|
||||||
@ -31,6 +32,8 @@ else ()
|
|||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
add_definitions( -DPACKAGE="encfs" )
|
||||||
|
|
||||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
|
# http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(CMAKE_MACOSX_RPATH ON)
|
set(CMAKE_MACOSX_RPATH ON)
|
||||||
@ -65,7 +68,6 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
find_program (POD2MAN pod2man)
|
find_program (POD2MAN pod2man)
|
||||||
include (FindGettext)
|
|
||||||
|
|
||||||
# Check for include files and stdlib properties.
|
# Check for include files and stdlib properties.
|
||||||
include (CheckIncludeFileCXX)
|
include (CheckIncludeFileCXX)
|
||||||
@ -115,6 +117,14 @@ configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake
|
|||||||
include_directories (${CMAKE_BINARY_DIR})
|
include_directories (${CMAKE_BINARY_DIR})
|
||||||
include_directories (${CMAKE_SOURCE_DIR})
|
include_directories (${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
if (ENABLE_NLS)
|
||||||
|
add_subdirectory(po)
|
||||||
|
|
||||||
|
add_definitions(-DENABLE_NLS)
|
||||||
|
add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/share/locale")
|
||||||
|
endif (ENABLE_NLS)
|
||||||
|
|
||||||
set(SOURCE_FILES
|
set(SOURCE_FILES
|
||||||
encfs/autosprintf.cpp
|
encfs/autosprintf.cpp
|
||||||
encfs/base64.cpp
|
encfs/base64.cpp
|
||||||
@ -205,17 +215,6 @@ if (POD2MAN)
|
|||||||
DESTINATION share/man/man1)
|
DESTINATION share/man/man1)
|
||||||
endif (POD2MAN)
|
endif (POD2MAN)
|
||||||
|
|
||||||
# Translations
|
|
||||||
if (GETTEXT_FOUND)
|
|
||||||
file(GLOB po_files "po/*.po")
|
|
||||||
foreach(pofile ${po_files})
|
|
||||||
get_filename_component(lang ${pofile} NAME_WE)
|
|
||||||
#message("-- Found gettext PO file for ${lang}: ${pofile}")
|
|
||||||
|
|
||||||
gettext_process_po_files(${lang} ALL PO_FILES ${pofile})
|
|
||||||
endforeach()
|
|
||||||
endif (GETTEXT_FOUND)
|
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_test (NAME checkops
|
add_test (NAME checkops
|
||||||
|
4
po/CMakeLists.txt
Normal file
4
po/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
find_package (Gettext REQUIRED)
|
||||||
|
|
||||||
|
file (GLOB POFILES *.po)
|
||||||
|
GETTEXT_CREATE_TRANSLATIONS (encfs.pot ALL ${POFILES})
|
Loading…
Reference in New Issue
Block a user