cmake.backbone/GettextCommonRules.cmake

31 lines
1.0 KiB
CMake
Raw Normal View History

2015-10-19 12:11:35 +03:00
SET (GETTEXT_PACKAGE "${PROJECT_LOWERCASE_NAME}-${MAJOR}")
ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}")
2015-10-19 18:27:24 +03:00
FIND_PACKAGE (Gettext REQUIRED)
2015-10-19 12:11:35 +03:00
2015-10-19 18:27:24 +03:00
# Custom locale directory
SET (LOCALEDIR "share/locale" CACHE STRING "Directory to install l10n files into")
MESSAGE(STATUS "Using LOCALEDIR=${LOCALEDIR}")
2015-10-19 12:11:35 +03:00
ADD_DEFINITIONS (-DLOCALEDIR="${LOCALEDIR}")
2015-10-19 18:27:24 +03:00
# for each language
INCLUDE (MacroSubdirList)
SUBDIRLIST (SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
FOREACH (subdir ${SUBDIRS})
ADD_SUBDIRECTORY (${subdir})
ENDFOREACH()
2015-10-19 12:11:35 +03:00
# configure a header file for Gettext
STRING (TOUPPER "${CMAKE_PROJECT_NAME}" GettextUniqueHeader)
CONFIGURE_FILE (
2015-10-19 19:27:15 +03:00
"${CMAKE_SOURCE_DIR}/cmake/backbone/templates/gettext-config.h.in"
2015-10-19 18:27:24 +03:00
"${CMAKE_CURRENT_BINARY_DIR}/gettext-config.h"
2015-10-19 12:11:35 +03:00
)
# check for msgmerge utility
IF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
MESSAGE (FATAL_ERROR "Please install msgmerge binary")
ENDIF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
IF (NOT GETTEXT_MSGFMT_EXECUTABLE)
MESSAGE(FATAL_ERROR "Please install msgmerge binary")
ENDIF (NOT GETTEXT_MSGFMT_EXECUTABLE)