File: FindGettext.cmake

package info (click to toggle)
performous 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,712 kB
  • ctags: 3,399
  • sloc: cpp: 16,764; ansic: 2,015; sh: 675; xml: 463; python: 355; makefile: 16
file content (39 lines) | stat: -rw-r--r-- 1,102 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# - Try to find Gettext
# Once done, this will define
#
#  Gettext_FOUND - system has Gettext
#  Gettext_INCLUDE_DIRS - the Gettext include directories
#  Gettext_LIBRARIES - link these to use Gettext
#
# See documentation on how to write CMake scripts at
# http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries

include(LibFindMacros)

libfind_pkg_check_modules(Gettext_PKGCONF Gettext)

find_path(Gettext_INCLUDE_DIR
  NAMES libintl.h
  HINTS ${Gettext_PKGCONF_INCLUDE_DIRS}
)
set(Gettext_PROCESS_INCLUDES Gettext_INCLUDE_DIR)

# On "traditional" UNIX systems (Solaris, BSD, Mac OS X, etc.),
# libintl is its own library. On GNU/glibc systems (Linux), gettext
# functionality is integrated into glibc, so we always have working
# internationalization support. Therefore we try to find a libintl
# but ignore the fact that it may not exist.

find_library(Gettext_LIBRARY
  NAMES intl
  HINTS ${Gettext_PKGCONF_LIBRARY_DIRS}
  PATHS /opt/local/lib /sw/local/lib
)

if (Gettext_LIBRARY)
  set(Gettext_PROCESS_LIBS Gettext_LIBRARY)
else()
  unset(Gettext_LIBRARY CACHE)
endif()

libfind_process(Gettext)