Commit 47a2c085 authored by Milan Crha's avatar Milan Crha

Make sure intltool-merge cache is created only once

Similar to GNOME/evolution#196
when intltool-merge is called in parallel, it could either rewrite
the ongoing attempt to build it or use an incomplete data, which
results in broken output files (.desktop, .metainfo and so on).
This change ensures the intltool-merge cache is created only once
and any other requests which would use it will wait until it's created.
parent b7f1b915
......@@ -176,9 +176,18 @@ macro(intltool_merge _in_filename _out_filename)
DEPENDS ${_in}
)
else(_has_no_translations)
if(NOT TARGET intltool-merge-cache)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache
COMMAND ${INTLTOOL_MERGE} ${_args} --quiet --cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
DEPENDS ${_in}
)
add_custom_target(intltool-merge-cache ALL
DEPENDS ${CMAKE_BINARY_DIR}/po/.intltool-merge-cache)
endif(NOT TARGET intltool-merge-cache)
add_custom_command(OUTPUT ${_out}
COMMAND ${INTLTOOL_MERGE} ${_args} --quiet --cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
DEPENDS ${_in}
DEPENDS ${_in} intltool-merge-cache
)
endif(_has_no_translations)
endmacro(intltool_merge)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment