cmake: Fix iconv detection on FreeBSD.

This commit is contained in:
Andreas Schneider 2013-07-14 15:51:09 +02:00
parent bdb3772e8f
commit 341e0e8967
3 changed files with 17 additions and 11 deletions

View file

@ -43,6 +43,7 @@ else()
check_function_exists(iconv HAVE_ICONV)
endif()
if (HAVE_ICONV_H OR HAVE_SYS_ICONV_H)
if (HAVE_ICONV_H)
set(_ICONV_PROTO_INCLUDE "iconv.h")
endif (HAVE_ICONV_H)
@ -50,11 +51,14 @@ if (HAVE_SYS_ICONV_H)
set(_ICONV_PROTO_INCLUDE "sys/iconv.h")
endif (HAVE_SYS_ICONV_H)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
check_prototype_definition(iconv
"size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)"
"-1"
${_ICONV_PROTO_INCLUDE}
HAVE_ICONV_CONST)
set(CMAKE_REQUIRED_INCLUDES)
endif (HAVE_ICONV_H OR HAVE_SYS_ICONV_H)
set(ICONV_INCLUDE_DIRS
${ICONV_INCLUDE_DIR}

View file

@ -12,6 +12,7 @@ set(CSYNC_PUBLIC_INCLUDE_DIRS
)
set(CSYNC_PRIVATE_INCLUDE_DIRS
${ICONV_INCLUDE_DIRS}
${INIPARSER_INCLUDE_DIRS}
${SQLITE3_INCLUDE_DIRS}
${CSTDLIB_PUBLIC_INCLUDE_DIRS}

View file

@ -6,6 +6,7 @@ set(CSTDLIB_PUBLIC_INCLUDE_DIRS
)
set(CSYNC_PRIVATE_INCLUDE_DIRS
${ICONV_INCLUDE_DIRS}
)
set(CSTDLIB_LIBRARY