view cmake/FindNLS.cmake @ 646:cba9782e10a7

is_number: use trailing return syntax
author David Demelier <markand@malikania.fr>
date Wed, 01 Aug 2018 14:08:19 +0200
parents 01e01777ff50
children
line wrap: on
line source

# FindNLS
# -------
#
# NLS_INCLUDE_DIRS, where to find libintl.h
# NLS_LIBRARIES, where to find library
# NLS_FOUND, if it is found

include(CheckFunctionExists)

# find libintl.h
find_path(NLS_INCLUDE_DIR libintl.h)

# find libintl.so
find_library(NLS_LIBRARY NAMES libintl intl)

# On Linux gettext is directly in libc
if (NOT NLS_LIBRARY)
    check_function_exists(gettext _HAVE_GETTEXT_FUNC)
    check_function_exists(bindtextdomain _HAVE_BINDTEXTDOMAIN_FUNC)
    set(NLS_LIBRARY "c")
endif ()

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(
    NLS
    REQUIRED_VARS NLS_INCLUDE_DIR NLS_LIBRARY
)

if (NLS_FOUND)
    set(NLS_INCLUDE_DIRS ${NLS_INCLUDE_DIR})
    set(NLS_LIBRARIES ${NLS_LIBRARIES})
endif ()

mark_as_advanced(NLS_INCLUDE_DIR NLS_LIBRARY)