From 58a0bd85c4070f3cea2fcb9ffa377e92878418b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 12 Nov 2019 19:50:34 +0100 Subject: [PATCH] Improve Cmake target for translations. Still not perfect. --- translations/CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt index a181f7b..c553dee 100644 --- a/translations/CMakeLists.txt +++ b/translations/CMakeLists.txt @@ -1,4 +1,16 @@ -add_custom_target(translations ALL - COMMAND ./generate-mo.sh "${PROJECT_BINARY_DIR}/translations/output" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating translation locales") +add_custom_target(translations + DEPENDS + "${PROJECT_BINARY_DIR}/translations/output/" + ) + +add_custom_command(DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/pot/po/*" + OUTPUT + "${PROJECT_BINARY_DIR}/translations/output/" + COMMAND + COMMAND ./generate-mo.sh "${PROJECT_BINARY_DIR}/translations/output" + WORKING_DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT + "Generating translation locales" + )