Make zigzag encoding of externIds optional
[hiphop-php.git] / CMake / FindLibIntl.cmake
blob37154b49050edd28ff68c51e1f7d1fd381124adc
1 #.rst:
2 # FindIntl
3 # --------
5 # Find the Gettext libintl headers and libraries.
7 # This module reports information about the Gettext libintl
8 # installation in several variables.  General variables::
10 #   Intl_FOUND - true if the libintl headers and libraries were found
11 #   Intl_INCLUDE_DIRS - the directory containing the libintl headers
12 #   Intl_LIBRARIES - libintl libraries to be linked
14 # The following cache variables may also be set::
16 #   Intl_INCLUDE_DIR - the directory containing the libintl headers
17 #   Intl_LIBRARY - the libintl library (if any)
19 # .. note::
20 #   On some platforms, such as Linux with GNU libc, the gettext
21 #   functions are present in the C standard library and libintl
22 #   is not required.  ``Intl_LIBRARIES`` will be empty in this
23 #   case.
25 # .. note::
26 #   If you wish to use the Gettext tools (``msgmerge``,
27 #   ``msgfmt``, etc.), use :module:`FindGettext`.
30 # Written by Roger Leigh <rleigh@codelibre.net>
32 #=============================================================================
33 # CMake - Cross Platform Makefile Generator
34 # Copyright 2000-2015 Kitware, Inc.
35 # Copyright 2000-2011 Insight Software Consortium
36 # All rights reserved.
38 # Redistribution and use in source and binary forms, with or without
39 # modification, are permitted provided that the following conditions
40 # are met:
42 # * Redistributions of source code must retain the above copyright
43 #   notice, this list of conditions and the following disclaimer.
45 # * Redistributions in binary form must reproduce the above copyright
46 #   notice, this list of conditions and the following disclaimer in the
47 #   documentation and/or other materials provided with the distribution.
49 # * Neither the names of Kitware, Inc., the Insight Software Consortium,
50 #   nor the names of their contributors may be used to endorse or promote
51 #   products derived from this software without specific prior written
52 #   permission.
54 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 # ------------------------------------------------------------------------------
68 # The above copyright and license notice applies to distributions of
69 # CMake in source and binary form.  Some source files contain additional
70 # notices of original copyright by their contributors; see each source
71 # for details.  Third-party software packages supplied with CMake under
72 # compatible licenses provide their own copyright notices documented in
73 # corresponding subdirectories.
75 # ------------------------------------------------------------------------------
77 # CMake was initially developed by Kitware with the following sponsorship:
79 #  * National Library of Medicine at the National Institutes of Health
80 #    as part of the Insight Segmentation and Registration Toolkit (ITK).
82 #  * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
83 #    Visualization Initiative.
85 #  * National Alliance for Medical Image Computing (NAMIC) is funded by the
86 #    National Institutes of Health through the NIH Roadmap for Medical Research,
87 #    Grant U54 EB005149.
89 #  * Kitware, Inc.
91 #=============================================================================
93 # Find include directory
94 find_path(LIBINTL_INCLUDE_DIR
95           NAMES "libintl.h"
96           DOC "libintl include directory")
97 mark_as_advanced(LIBINTL_INCLUDE_DIR)
99 # Find all Intl libraries
100 find_library(LIBINTL_LIBRARY "intl"
101   DOC "libintl libraries (if not in the C library)")
102 mark_as_advanced(LIBINTL_LIBRARY)
104 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBINTL
105                                   REQUIRED_VARS LIBINTL_INCLUDE_DIR
106                                   FAIL_MESSAGE "Failed to find Gettext libintl")
108 if(LIBINTL_FOUND)
109   set(LIBINTL_INCLUDE_DIRS "${LIBINTL_INCLUDE_DIR}")
110   if(LIBINTL_LIBRARY)
111     set(LIBINTL_LIBRARIES "${LIBINTL_LIBRARY}")
112   else()
113     unset(LIBINTL_LIBRARIES)
114   endif()
115 endif()