File: FindLibintl.cmake

package info (click to toggle)
sdcv 0.5.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 596 kB
  • sloc: cpp: 3,082; sh: 226; xml: 23; makefile: 10
file content (56 lines) | stat: -rw-r--r-- 1,564 bytes parent folder | download | duplicates (4)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Try to find the libintl library. Explicit searching is currently
# only required for Win32, though it might be useful for some UNIX
# variants, too. Therefore code for searching common UNIX include
# directories is included, too.
#
# Once done this will define
#
#  LIBINTL_FOUND - system has libintl
#  LIBINTL_LIBRARIES - libraries needed for linking

IF (LIBINTL_FOUND)
   SET(LIBINTL_FIND_QUIETLY TRUE)
ENDIF ()

# for Windows we rely on the environement variables
# %INCLUDE% and %LIB%; FIND_LIBRARY checks %LIB%
# automatically on Windows
IF(WIN32)
  FIND_LIBRARY(LIBINTL_LIBRARIES
    NAMES intl
  )
  IF(LIBINTL_LIBRARIES)
    SET(LIBINTL_FOUND TRUE)
  ELSE(LIBINTL_LIBRARIES)
    SET(LIBINTL_FOUND FALSE)
  ENDIF(LIBINTL_LIBRARIES)
ELSE()
  include(CheckFunctionExists)
  check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
  if (LIBINTL_LIBC_HAS_DGETTEXT)
    find_library(LIBINTL_LIBRARIES NAMES c)
    set(LIBINTL_FOUND TRUE)
  else (LIBINTL_LIBC_HAS_DGETTEXT)
    find_library(LIBINTL_LIBRARIES 
      NAMES intl libintl 
      PATHS /usr/lib /usr/local/lib
    )
    IF(LIBINTL_LIBRARIES)
      SET(LIBINTL_FOUND TRUE)
    ELSE(LIBINTL_LIBRARIES)
      SET(LIBINTL_FOUND FALSE)
    ENDIF(LIBINTL_LIBRARIES)
  ENDIF (LIBINTL_LIBC_HAS_DGETTEXT)
ENDIF()

IF (LIBINTL_FOUND)
  IF (NOT LIBINTL_FIND_QUIETLY)
    MESSAGE(STATUS "Found libintl: ${LIBINTL_LIBRARIES}")
  ENDIF ()
ELSE ()
  IF (LIBINTL_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could NOT find libintl")
  ENDIF ()
ENDIF ()

MARK_AS_ADVANCED(LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT)