aboutsummaryrefslogtreecommitdiff
path: root/modules/FindGettext.cmake
diff options
context:
space:
mode:
authorChusslove Illich <caslav.ilic@gmx.net>2006-03-18 15:18:02 +0000
committerChusslove Illich <caslav.ilic@gmx.net>2006-03-18 15:18:02 +0000
commit1da5e248e7cb198bf97c55f5b66b3158c94adeeb (patch)
tree0401b1c7dfc066cb317030058814472760ca3b46 /modules/FindGettext.cmake
parentecf012bb6d0fc2551bb638b931d84ef3e4c1ede5 (diff)
downloadextra-cmake-modules-1da5e248e7cb198bf97c55f5b66b3158c94adeeb.tar.gz
extra-cmake-modules-1da5e248e7cb198bf97c55f5b66b3158c94adeeb.tar.bz2
CMake configure check for Gettext, rudimentary only.
svn path=/trunk/KDE/kdelibs/; revision=520012
Diffstat (limited to 'modules/FindGettext.cmake')
-rw-r--r--modules/FindGettext.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/FindGettext.cmake b/modules/FindGettext.cmake
new file mode 100644
index 00000000..b6dd3de5
--- /dev/null
+++ b/modules/FindGettext.cmake
@@ -0,0 +1,35 @@
+# Try to find Gettext functionality
+# Once done this will define
+#
+# GETTEXT_FOUND - system has Gettext
+# 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).
+
+INCLUDE(CheckIncludeFiles)
+check_include_files(libintl.h HAVE_LIBINTL_H)
+
+set(GETTEXT_INCLUDE_DIR)
+set(GETTEXT_LIBRARIES)
+
+if(HAVE_LIBINTL_H)
+ set(GETTEXT_FOUND TRUE)
+ set(GETTEXT_SOURCE "libintl.h")
+endif(HAVE_LIBINTL_H)
+
+if(GETTEXT_FOUND)
+ if(NOT Gettext_FIND_QUIETLY)
+ message(STATUS "Gettext functionality present (${GETTEXT_SOURCE})")
+ endif(NOT Gettext_FIND_QUIETLY)
+else(GETTEXT_FOUND)
+ if(NOT Gettext_FIND_QUIETLY)
+ message(STATUS "Gettext functionality NOT present, "
+ "translations will not be available")
+ endif(NOT Gettext_FIND_QUIETLY)
+endif(GETTEXT_FOUND)
+
+MARK_AS_ADVANCED(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES)