forked from darktable-org/darktable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
29 lines (26 loc) · 908 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
find_program(po4a-updatepo_BIN po4a-updatepo)
# target to update .po files
if(${po4a-updatepo_BIN} STREQUAL "po4a-updatepo_BIN-NOTFOUND")
message("Missing po4a-updatepo. Can NOT update manpage translations")
else()
add_custom_target(update-manpages)
set(files)
set(deps)
foreach(source ${MANPAGE_SOURCES})
list(APPEND files "-m")
list(APPEND files ${source})
list(APPEND deps ../${source})
endforeach(source)
file(STRINGS "LINGUAS" LANGUAGES)
foreach(language ${LANGUAGES})
set(pofile "${language}.po")
add_custom_command(
OUTPUT ${pofile}
COMMAND sh -c "${po4a-updatepo_BIN} -f pod ${files} -p po/${pofile}"
DEPENDS ${deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../
)
add_custom_target(update-manpage-${language} DEPENDS ${pofile})
add_dependencies(update-manpages update-manpage-${language})
endforeach(language)
endif()