tag 583258 + patch
thanks

Hello Modestas,
as per your request (via IRC) I'll send a minimal version of a patch I'd like to
see included upstream. Apart from that, I'd like to see the part marked as
"TODO" done too, but don't have time to do so myself at the moment.


Modestas Vainius schrieb am 26.05.2010 um 19:21:
> On trečiadienis 26 Gegužė 2010 20:08:58 Kai Wasserbäch wrote:
>> P.S.: The reason why I don't just use the KDE version of the script is,
>> that I'm writing a small program which hasn't any dependencies on KDE.
>> And even though I could copy the FindGettext.cmake script from KDE and
>> provide a local version, I think this should best be addressed upstream.
> 
> Yes, it should be addressed upstream. But in the meantime, you should just 
> ship a local version if you need a specific feature. Of course it would be 
> better if you reported this bug to upstream yourself so I don't have to play 
> proxy. Request is yours after all. Their BTS is at 
> http://public.kitware.com/Bug/

As I told you on IRC already: as I don't have an account with that tracker I'd
be very grateful, if you could forward the bug report for me. ;)

Kind regards,
Kai Wasserbäch



-- 

Kai Wasserbäch (Kai Wasserbaech)

E-Mail: deb...@carbon-project.org
Jabber (debianforum.de): Drizzt
URL: http://wiki.debian.org/C%C3%B9ran
GnuPG: 0xE1DE59D2      0600 96CE F3C8 E733 E5B6 1587 A309 D76C E1DE 59D2
(http://pgpkeys.pca.dfn.de/pks/lookup?search=0xE1DE59D2&fingerprint=on&hash=on&op=vindex)
--- FindGettext.cmake.orig	2010-05-26 23:29:11.000000000 +0200
+++ FindGettext.cmake	2010-05-26 23:39:08.000000000 +0200
@@ -65,14 +65,70 @@
 
 ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
 
-IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+
+#
+# The following part is taken from KDE's FindGettext.cmake
+#
+#  GETTEXT_INCLUDE_DIR - Gettext include directory
+#  GETTEXT_LIBRARIES - Libraries needed to use Gettext
+
+# TODO: This will enable translations only if Gettext functionality is
+# present in libc. Must have more robust system for release, where Gettext
+# functionality can also reside in standalone Gettext library, or the one
+# embedded within kdelibs (cf. gettext.m4 from Gettext source).
+#
+# Copyright (c) 2006, Chusslove Illich, <caslav.i...@gmx.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+    
+    # in cache already
+    set(GETTEXT_LIBINC_FOUND TRUE)
+    
+else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+    include(CheckLibraryExists)
+    include(CheckFunctionExists)
+
+    find_path(GETTEXT_INCLUDE_DIR libintl.h)
+    if(GETTEXT_INCLUDE_DIR)
+        set(HAVE_LIBINTL_H 1)
+    else(GETTEXT_INCLUDE_DIR)
+        set(HAVE_LIBINTL_H 0)
+    endif(GETTEXT_INCLUDE_DIR)
+                
+    set(GETTEXT_LIBRARIES)
+
+    if (HAVE_LIBINTL_H)
+        check_function_exists(dgettext LIBC_HAS_DGETTEXT)
+        if (LIBC_HAS_DGETTEXT)
+            set(GETTEXT_SOURCE "built in libc")
+            set(GETTEXT_LIBINC_FOUND TRUE)
+        else (LIBC_HAS_DGETTEXT)
+            find_library(LIBINTL_LIBRARY NAMES intl libintl )
+
+            check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
+            if (LIBINTL_HAS_DGETTEXT)
+                set(GETTEXT_SOURCE "in ${LIBINTL_LIBRARY}")
+                set(GETTEXT_LIBRARIES ${LIBINTL_LIBRARY})
+                set(GETTEXT_LIBINC_FOUND TRUE)
+            endif (LIBINTL_HAS_DGETTEXT)
+        endif (LIBC_HAS_DGETTEXT)
+    endif (HAVE_LIBINTL_H)
+endif (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+
+
+IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND GETTEXT_LIBINC_FOUND )
    SET(GETTEXT_FOUND TRUE)
-ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+   if (NOT Gettext_FIND_QUIETLY)
+      message(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
+   endif (NOT Gettext_FIND_QUIETLY)
+ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND GETTEXT_LIBINC_FOUND )
    SET(GETTEXT_FOUND FALSE)
    IF (GetText_REQUIRED)
       MESSAGE(FATAL_ERROR "GetText not found")
    ENDIF (GetText_REQUIRED)
-ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-
-
+ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE AND GETTEXT_LIBINC_FOUND )
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to