From aa8b5370acac37552ed83aeb39e5360cb027038d Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Fri, 9 Sep 2016 15:43:06 +0200 Subject: [PATCH] add target to rebuild pot file --- po/CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 719436f..21be65f 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -2,3 +2,27 @@ find_package (Gettext REQUIRED) file (GLOB POFILES *.po) GETTEXT_CREATE_TRANSLATIONS (encfs.pot ALL ${POFILES}) + +find_program(XGETTEXT_CMD xgettext) + +set(_xgettext_option_list --language=C + --keyword=_ + --keyword=N_ + --keyword=C_:1c,2 + --keyword=NC_:1c,2 -s + --package-name=encfs + --package-version=${ENCFS_VERSION}) + +set(_potFile encfs.pot) +file(GLOB _src_list ../**/*.cpp) + +if(XGETTEXT_CMD) + ADD_CUSTOM_COMMAND(OUTPUT ${_potFile} + COMMAND ${XGETTEXT_CMD} ${_xgettext_option_list} -o ${_potFile} ${_src_list} + DEPENDS ${_src_list} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Extract translatable messages to ${_potFile}") + + ADD_CUSTOM_TARGET(pot_file ${_all} + DEPENDS ${_potFile}) +endif()