SET (GETTEXT_PACKAGE "${PROJECT_LOWERCASE_NAME}-${MAJOR}") ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}") # FIXME: Custom locale directory IF (WIN32) SET (LOCALEDIR "") ELSE () SET (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale") ENDIF () SET (CUSTOM_LOCALEDIR "" CACHE STRING "Directory to install l10n files into") IF (NOT CUSTOM_LOCALEDIR STREQUAL "") SET (LOCALEDIR "${CUSTOM_LOCALEDIR}") MESSAGE(STATUS "Using LOCALEDIR=${LOCALEDIR}") ENDIF () ADD_DEFINITIONS (-DLOCALEDIR="${LOCALEDIR}") SET (LOCALE_INSTALL_DIR "share/locale") # by all langs INCLUDE (MacroOptionalAddSubdirectory) FIND_PACKAGE (Gettext REQUIRED) MACRO_OPTIONAL_ADD_SUBDIRECTORY (langs) # configure a header file for Gettext STRING (TOUPPER "${CMAKE_PROJECT_NAME}" GettextUniqueHeader) CONFIGURE_FILE ( "gettext-config.h.in" "${PROJECT_BINARY_DIR}/po/gettext-config.h" ) # 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)