From 8b1d56ea9e39c7f73165bba81c0c41090d12de5e Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 3 Apr 2015 14:19:52 +0200 Subject: [PATCH] Fix build with CMake on Mac OS X. --- coreapi/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 73fa16fb9..ec2123a62 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -166,7 +166,12 @@ if(WIN32 AND "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone") set_target_properties(linphone PROPERTIES PREFIX "lib") endif() if(ICONV_FOUND) - target_include_directories(linphone PUBLIC ${ICONV_INCLUDE_DIRS}) + if(APPLE) + # Prevent conflict between the system iconv.h header and the one from macports. + target_compile_options(linphone PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h") + else() + target_include_directories(linphone PRIVATE ${ICONV_INCLUDE_DIRS}) + endif() endif() install(TARGETS linphone EXPORT LinphoneTargets