On Пятница 09 сентября 2011 11:21:30 David Coppa wrote:
> Hi all,
> 
> This is an update to cmake-2.8.5:
> 
> "100% tests passed, 0 tests failed out of 193"
> 
> Tested on my amd64 lappy and built some stuff using it.
> Maybe this is worth a bulk... (landry?)

Thank you. Tested here on a few KDE4-related builds, works fine.

Could I suggest the following patch with GETTEXT_PROCESS_PO_FILES macro? 
It's taken from KDE4 own FindGettext.cmake module. Without it, digikam 
(from KDE4) fails to build with both "system" (provided by CMake 
distribution) and KDE4 versions: first one doesn't provide such macro, 
and second one fails to find Gettext. Of course, I could patch KDE4 
version instead, but IMHO it's better not to have two different versions 
of the same module in the system, this generates too much pain. And if 
someone has better idea, I'm all for it. :)

--
  WBR,
  Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



--- Modules/FindGettext.cmake.orig      Sun Sep 11 05:27:19 2011
+++ Modules/FindGettext.cmake   Sun Sep 11 05:27:59 2011
@@ -65,6 +65,43 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFil
 
 ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
 
+MACRO(GETTEXT_PROCESS_PO_FILES _lang)
+   SET(_gmoFiles)
+   SET(_args ${ARGN})
+   SET(_addToAll)
+   SET(_installDest)
+
+   LIST(GET _args 0 _tmp)
+   IF("${_tmp}" STREQUAL "ALL")
+      SET(_addToAll ALL)
+      LIST(REMOVE_AT _args 0)
+   ENDIF("${_tmp}" STREQUAL "ALL")
+   
+   LIST(GET _args 0 _tmp)
+   IF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+      LIST(GET _args 1 _installDest )
+      LIST(REMOVE_AT _args 0 1)
+   ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+   
+#    message(STATUS "2 all ${_addToAll} dest ${_installDest} args: 
${_args}")
+   
+   FOREACH(_current_PO_FILE ${_args})
+      GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE)
+      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
+      add_custom_command(OUTPUT ${_gmoFile}
+            COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} 
${_current_PO_FILE}
+            WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+            DEPENDS ${_current_PO_FILE}
+         )
+
+      IF(_installDest)
+         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo 
DESTINATION ${_installDest}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
+      ENDIF(_installDest)
+      LIST(APPEND _gmoFiles ${_gmoFile})
+   ENDFOREACH(_current_PO_FILE)
+   ADD_CUSTOM_TARGET(pofiles ${_addToAll} DEPENDS ${_gmoFiles})
+ENDMACRO(GETTEXT_PROCESS_PO_FILES)
+
 IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
    SET(GETTEXT_FOUND TRUE)
 ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )

Reply via email to