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.
This commit is contained in:
whitequark 2017-04-08 18:37:02 +00:00
parent 287bd98a3f
commit 5d67b42842

View File

@ -229,11 +229,14 @@ if(HAVE_GETTEXT)
file(GLOB locale_pos ${CMAKE_CURRENT_SOURCE_DIR}/../res/locales/*.po) file(GLOB locale_pos ${CMAKE_CURRENT_SOURCE_DIR}/../res/locales/*.po)
string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} 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} string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
gen_output_po ${output_po}) gen_output_po ${output_po}.gen)
string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} foreach(locale_po ${locale_pos})
gen_locale_pos "${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( add_custom_command(
OUTPUT ${gen_output_pot} OUTPUT ${gen_output_pot}
@ -271,7 +274,7 @@ if(HAVE_GETTEXT)
foreach(locale_po ${locale_pos}) foreach(locale_po ${locale_pos})
string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} 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) get_filename_component(locale_name ${locale_po} NAME_WE)
if(locale_name STREQUAL "en_US") if(locale_name STREQUAL "en_US")