From: Tim Goya Date: Mon, 10 Dec 2007 18:42:02 +0000 (+0000) Subject: Fix CMake xgettext issues X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7be2f8f61386b9fbefde7dca597ae8f0fe92df15;p=supertux.git Fix CMake xgettext issues SVN-Revision: 5190 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a47a0b2c3..725b3f993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,22 +216,19 @@ ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) 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}" @@ -246,7 +243,8 @@ IF(GENERATE_MESSAGESPOT) 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}" @@ -260,7 +258,7 @@ IF(GENERATE_MESSAGESPOT) DEPENDS ${MESSAGES_POT_FILES} ) - ENDIF(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND") + ENDIF(NOT XGETTEXT_EXECUTABLE) ENDIF(GENERATE_MESSAGESPOT) ## Some additional compiler switches