Gettext: add ${CMAKE_BUILD_DIR}/share/locale/lang/LC_MESSAGES... for debugging.
This commit is contained in:
parent
a0b6683360
commit
1df5dd35c7
|
@ -10,7 +10,9 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
|
||||||
get_filename_component(_name ${_current_PO_FILE} NAME)
|
get_filename_component(_name ${_current_PO_FILE} NAME)
|
||||||
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
|
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
|
||||||
set(_basenameMAJOR ${_basename}-${MAJOR})
|
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}
|
add_custom_command(OUTPUT ${_gmoFile}
|
||||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
@ -18,7 +20,7 @@ function(GETTEXT_PROCESS_PO_FILES _lang)
|
||||||
)
|
)
|
||||||
|
|
||||||
if(_parsedArguments_INSTALL_DESTINATION)
|
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()
|
endif()
|
||||||
list(APPEND _gmoFiles ${_gmoFile})
|
list(APPEND _gmoFiles ${_gmoFile})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
@ -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}.h DESTINATION include)
|
||||||
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.vapi DESTINATION share/vala/vapi)
|
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.vapi DESTINATION share/vala/vapi)
|
||||||
ENDIF (LibInstall)
|
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}/..)
|
||||||
|
|
Loading…
Reference in New Issue