From 5d67b42842b98a350cbe0ae5fed2b9db1f0bb8cb Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 8 Apr 2017 18:37:02 +0000 Subject: [PATCH] CMake: don't have multiple rules generating same targets. There was a copy rule that copied the locale from the source to the binary directory, and also a regeneration rule that used the locale in the binary directory as a temporary file. Rename the target for the latter. --- src/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19f5e3f..4363bcf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -229,11 +229,14 @@ if(HAVE_GETTEXT) file(GLOB locale_pos ${CMAKE_CURRENT_SOURCE_DIR}/../res/locales/*.po) string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} - gen_output_pot ${output_pot}) + gen_output_pot ${output_pot}.gen) string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} - gen_output_po ${output_po}) - string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} - gen_locale_pos "${locale_pos}") + gen_output_po ${output_po}.gen) + foreach(locale_po ${locale_pos}) + string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} + gen_locale_po ${locale_po}.gen) + list(APPEND gen_locale_pos ${gen_locale_po}) + endforeach() add_custom_command( OUTPUT ${gen_output_pot} @@ -271,7 +274,7 @@ if(HAVE_GETTEXT) foreach(locale_po ${locale_pos}) string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} - gen_locale_po ${locale_po}) + gen_locale_po ${locale_po}.gen) get_filename_component(locale_name ${locale_po} NAME_WE) if(locale_name STREQUAL "en_US")