Gettext: add ${CMAKE_BUILD_DIR}/share/locale/lang/LC_MESSAGES... for debugging.

This commit is contained in:
Kolan Sh 2015-11-14 01:58:56 +03:00
parent a0b6683360
commit 1df5dd35c7
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,9 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
get_filename_component(_name ${_current_PO_FILE} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
set(_basenameMAJOR ${_basename}-${MAJOR})
set(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basenameMAJOR}.gmo)
set(installDIR ${CMAKE_BINARY_DIR}/share/locale/${_lang}/LC_MESSAGES)
file(MAKE_DIRECTORY ${installDIR})
set(_gmoFile ${installDIR}/${_basenameMAJOR}.mo)
add_custom_command(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
@ -18,7 +20,7 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
)
if(_parsedArguments_INSTALL_DESTINATION)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basenameMAJOR}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basenameMAJOR}.mo)
install(FILES ${installDIR}/${_basenameMAJOR}.mo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/)
endif()
list(APPEND _gmoFiles ${_gmoFile})
endforeach()

View File

@ -38,3 +38,6 @@ IF (LibInstall)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.h DESTINATION include)
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.vapi DESTINATION share/vala/vapi)
ENDIF (LibInstall)
# Access to 'share' directory when debugging (Gettext, Glade, GSchema files, etc...)
EXECUTE_PROCESS (COMMAND ln -sf ${CMAKE_BINARY_DIR}/share -t ${CMAKE_CURRENT_BINARY_DIR}/..)