My CMake modules, scripts, templates
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GettextCommonRules.cmake 1.0KB

123456789101112131415161718192021222324252627282930
  1. SET (GETTEXT_PACKAGE "${PROJECT_LOWERCASE_NAME}-${MAJOR}")
  2. ADD_DEFINITIONS (-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}")
  3. FIND_PACKAGE (Gettext REQUIRED)
  4. # Custom locale directory
  5. SET (LOCALEDIR "share/locale" CACHE STRING "Directory to install l10n files into")
  6. MESSAGE(STATUS "Using LOCALEDIR=${LOCALEDIR}")
  7. ADD_DEFINITIONS (-DLOCALEDIR="${LOCALEDIR}")
  8. # for each language
  9. INCLUDE (MacroSubdirList)
  10. SUBDIRLIST (SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
  11. FOREACH (subdir ${SUBDIRS})
  12. ADD_SUBDIRECTORY (${subdir})
  13. ENDFOREACH()
  14. # configure a header file for Gettext
  15. STRING (TOUPPER "${CMAKE_PROJECT_NAME}" GettextUniqueHeader)
  16. CONFIGURE_FILE (
  17. "${CMAKE_SOURCE_DIR}/cmake/backbone/templates/gettext-config.h.in"
  18. "${CMAKE_CURRENT_BINARY_DIR}/gettext-config.h"
  19. )
  20. # check for msgmerge utility
  21. IF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
  22. MESSAGE (FATAL_ERROR "Please install msgmerge binary")
  23. ENDIF (NOT GETTEXT_MSGMERGE_EXECUTABLE)
  24. IF (NOT GETTEXT_MSGFMT_EXECUTABLE)
  25. MESSAGE(FATAL_ERROR "Please install msgmerge binary")
  26. ENDIF (NOT GETTEXT_MSGFMT_EXECUTABLE)