2013-04-15 14:42:24 +02:00
|
|
|
# Package finder for gettext libs and include files
|
|
|
|
|
|
|
|
SET(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
|
|
|
|
CACHE FILEPATH "path to custom gettext")
|
|
|
|
|
|
|
|
# by default
|
|
|
|
SET(GETTEXT_FOUND FALSE)
|
|
|
|
|
|
|
|
FIND_PROGRAM(GETTEXT_MSGFMT
|
|
|
|
NAMES msgfmt
|
|
|
|
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
|
|
|
DOC "path to msgfmt")
|
|
|
|
|
2015-04-09 20:09:36 +02:00
|
|
|
IF(GETTEXT_MSGFMT)
|
|
|
|
SET(GETTEXT_FOUND TRUE)
|
2013-04-15 14:42:24 +02:00
|
|
|
SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
|
2015-04-12 08:03:18 +02:00
|
|
|
SET(GETTEXT_MO_BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../data/locale/<locale>)
|
|
|
|
SET(GETTEXT_MO_DEST_PATH ${SHAREDIR}/locale/<locale>)
|
2013-04-15 14:42:24 +02:00
|
|
|
FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
|
2014-09-23 09:42:00 +02:00
|
|
|
LIST(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES voxelands.pot)
|
2013-04-15 14:42:24 +02:00
|
|
|
MACRO(SET_MO_PATHS _buildvar _destvar _locale)
|
|
|
|
STRING(REPLACE "<locale>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH})
|
|
|
|
STRING(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH})
|
|
|
|
ENDMACRO(SET_MO_PATHS)
|
|
|
|
ELSE()
|
|
|
|
SET(GETTEXT_INCLUDE_DIR "")
|
|
|
|
SET(GETTEXT_LIBRARY "")
|
|
|
|
ENDIF()
|