Browse Source

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

master
Kolan Sh 3 years ago
parent
commit
1df5dd35c7
2 changed files with 7 additions and 2 deletions
  1. 4
    2
      FindGettextOverride.cmake
  2. 3
    0
      ValaLibCommonRules.cmake

+ 4
- 2
FindGettextOverride.cmake View File

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

+ 3
- 0
ValaLibCommonRules.cmake View File

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

Loading…
Cancel
Save