katie/cmake/modules/FindIconv.cmake
Ivailo Monev fede7a03d6 various cleanup
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2016-11-16 17:31:45 +00:00

37 lines
852 B
CMake

# - Try to find Iconv
# Once done this will define
#
# ICONV_FOUND - system has Iconv
# ICONV_INCLUDES - the Iconv include directory
# ICONV_LIBRARIES - The libraries needed to use Iconv
#
# Copyright (c) 2016, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
if(ICONV_INCLUDES AND ICONV_LIBRARIES)
set(ICONV_FIND_QUIETLY TRUE)
endif()
# Iconv does not provide pkg-config files
find_path(ICONV_INCLUDES
NAMES
iconv.h
HINTS
$ENV{ICONVDIR}/include
${INCLUDE_INSTALL_DIR}
)
find_library(ICONV_LIBRARIES
NAMES
iconv c
HINTS
$ENV{ICONVDIR}/lib
${LIB_INSTALL_DIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Iconv DEFAULT_MSG ICONV_INCLUDES ICONV_LIBRARIES)
mark_as_advanced(ICONV_INCLUDES ICONV_LIBRARIES)