mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
CMake: Optimize use of target update-gmo
This commit is contained in:
parent
5a669fa62b
commit
b66f2a355f
@ -169,13 +169,14 @@ FIND_PROGRAM(LYX_GITVERSION git)
|
||||
set(LYX_UPDATED_GMO_FILES)
|
||||
foreach(_gmo_base ${INSTALLED_LANGUAGES})
|
||||
set(_gmo ${_gmo_base}.gmo)
|
||||
list(APPEND LYX_UPDATED_GMO_FILES "${LYX_DEST_PO}/${_gmo}")
|
||||
set(_tobeupdated "${CMAKE_CURRENT_BINARY_DIR}/${_gmo}.tobeupdated")
|
||||
list(APPEND LYX_UPDATED_GMO_FILES "${_tobeupdated}")
|
||||
if(LYX_GITVERSION)
|
||||
add_custom_command(
|
||||
OUTPUT "${LYX_DEST_PO}/${_gmo}"
|
||||
COMMAND "${LYX_GITVERSION}" "status" "--porcelain" "${_gmo_base}.po" ">" "${CMAKE_CURRENT_BINARY_DIR}/${_gmo}.tobeupdated"
|
||||
OUTPUT "${_tobeupdated}"
|
||||
COMMAND "${LYX_GITVERSION}" "status" "--porcelain" "${_gmo_base}.po" ">" "${_tobeupdated}"
|
||||
COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_CMAKE_PATH}/po/update-gmo.py"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${_gmo}.tobeupdated"
|
||||
"${_tobeupdated}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${_gmo}"
|
||||
"${LYX_DEST_PO}/${_gmo}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
@ -183,8 +184,9 @@ foreach(_gmo_base ${INSTALLED_LANGUAGES})
|
||||
)
|
||||
else()
|
||||
add_custom_command(
|
||||
OUTPUT "${LYX_DEST_PO}/${_gmo}"
|
||||
OUTPUT "${_tobeupdated}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/${_gmo}" "${LYX_DEST_PO}/${_gmo}"
|
||||
COMMAND ${CMAKE_COMMAND} -E touch "${_tobeupdated}"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_gmo}"
|
||||
)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user