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
23
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv c
30
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
32
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
34
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
35
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
37
check_cxx_source_compiles("
45
iconv(conv, &in, &ilen, &out, &olen);
48
" ICONV_SECOND_ARGUMENT_IS_CONST )
50
set(CMAKE_REQUIRED_INCLUDES)
51
set(CMAKE_REQUIRED_LIBRARIES)
54
IF(NOT ICONV_FIND_QUIETLY)
55
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
56
ENDIF(NOT ICONV_FIND_QUIETLY)
58
IF(Iconv_FIND_REQUIRED)
59
MESSAGE(FATAL_ERROR "Could not find Iconv")
60
ENDIF(Iconv_FIND_REQUIRED)
66
ICONV_SECOND_ARGUMENT_IS_CONST
b'\\ No newline at end of file'