2
# Once done this will define
4
# ICONV_FOUND - system has Iconv
5
# ICONV_INCLUDE_DIR - the Iconv include directory
6
# ICONV_LIBRARIES - Link these to use Iconv
7
# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
9
include(CheckCXXSourceCompiles)
11
IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
12
# Already in cache, be silent
13
SET(ICONV_FIND_QUIETLY TRUE)
14
ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
16
FIND_PATH(ICONV_INCLUDE_DIR iconv.h
21
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv c
27
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
29
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
31
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
32
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
34
check_cxx_source_compiles("
42
iconv(conv, &in, &ilen, &out, &olen);
45
" ICONV_SECOND_ARGUMENT_IS_CONST )
47
set(CMAKE_REQUIRED_INCLUDES)
48
set(CMAKE_REQUIRED_LIBRARIES)
51
IF(NOT ICONV_FIND_QUIETLY)
52
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
53
ENDIF(NOT ICONV_FIND_QUIETLY)
55
IF(Iconv_FIND_REQUIRED)
56
MESSAGE(FATAL_ERROR "Could not find Iconv")
57
ENDIF(Iconv_FIND_REQUIRED)
63
ICONV_SECOND_ARGUMENT_IS_CONST
b'\\ No newline at end of file'