File: FindGettext.cmake

package info (click to toggle)
darktable 1.4.2-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 19,940 kB
  • ctags: 22,185
  • sloc: ansic: 181,925; cpp: 32,612; lisp: 4,681; xml: 4,046; sh: 2,002; makefile: 395; python: 315; perl: 114; awk: 110; asm: 46
file content (42 lines) | stat: -rw-r--r-- 1,126 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
# - 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)

# On Linux there is no pkgconfig script, but with this we force Gettext_PKGCONF_INCLUDE_DIRS to ""
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  set(Gettext_PKGCONF_INCLUDE_DIRS "")
else(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  libfind_pkg_check_modules(Gettext_PKGCONF Gettext)
endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")

if(WIN32 OR APPLE)
  set(Gettext_LIBRARY_SEARCH_DIRS
    /opt/local/lib
    /sw/local/lib
  )

  find_library(Gettext_LIBRARY
    NAMES intl
    PATHS ${Gettext_LIBRARY_SEARCH_DIRS}
    HINTS ${Gettext_PKGCONF_LIBRARY_DIRS}
  )

  set(Gettext_PROCESS_LIBS Gettext_LIBRARY)
endif()

find_path(Gettext_INCLUDE_DIR
  NAMES libintl.h
  HINTS ${Gettext_PKGCONF_INCLUDE_DIRS}
  PATHS /opt/local/include
)

set(Gettext_PROCESS_INCLUDES Gettext_INCLUDE_DIR)
libfind_process(Gettext)