OPTION(GENERATE_MESSAGESPOT "Generate messages.pot files" ${DEBUG})
IF(GENERATE_MESSAGESPOT)
MARK_AS_ADVANCED(
- XGETTEXT
+ XGETTEXT_EXECUTABLE
)
- FIND_PROGRAM(
- XGETTEXT
- NAMES "xgettext"
- PATHS "/usr/bin"
- )
- IF(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND")
+ FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
+ IF(NOT XGETTEXT_EXECUTABLE)
MESSAGE(STATUS "Warning: xgettext not found - will not update messages.pot")
- ELSE(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND")
- MESSAGE(STATUS "Found xgettext: ${XGETTEXT}")
+ ELSE(NOT XGETTEXT_EXECUTABLE)
+ MESSAGE(STATUS "Found xgettext: ${XGETTEXT_EXECUTABLE}")
SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/data/locale/messages.pot)
ADD_CUSTOM_COMMAND(
OUTPUT ${MESSAGES_POT_FILE}
- COMMAND "/usr/bin/xgettext" --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES}
+ COMMAND ${XGETTEXT_EXECUTABLE}
+ ARGS --keyword=_ --language=C++ --output=${MESSAGES_POT_FILE} ${SUPERTUX_SOURCES}
DEPENDS ${SUPERTUX_SOURCES}
WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR}
COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
SET(MESSAGES_POT_FILE ${SUPERTUX_SOURCE_DIR}/${SUPERTUX_LEVEL_DIR}/messages.pot)
ADD_CUSTOM_COMMAND(
OUTPUT ${MESSAGES_POT_FILE}
- COMMAND "/usr/bin/xgettext" --keyword="_:1" --language=Lisp --sort-by-file --output=${MESSAGES_POT_FILE} ${SUPERTUX_LEVELS}
+ COMMAND ${XGETTEXT_EXECUTABLE}
+ ARGS --keyword="_:1" --language=Lisp --sort-by-file --output=${MESSAGES_POT_FILE} ${SUPERTUX_LEVELS}
DEPENDS ${SUPERTUX_LEVELS}
WORKING_DIRECTORY ${SUPERTUX_SOURCE_DIR}
COMMENT "Generating POT file ${MESSAGES_POT_FILE}"
DEPENDS ${MESSAGES_POT_FILES}
)
- ENDIF(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND")
+ ENDIF(NOT XGETTEXT_EXECUTABLE)
ENDIF(GENERATE_MESSAGESPOT)
## Some additional compiler switches