From a835c969d5dfae479532f7c3f9e0b5f0090bf609 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Tue, 11 Jun 2019 18:57:17 -0700 Subject: [PATCH] Link against Apple's modified iconv. (Because the SDK does, so we don't really have much of a choice.) --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a71e0d5..a5da135 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,13 @@ find_package(boost_optional MODULE REQUIRED) find_package(libxml2 MODULE REQUIRED) find_package(zlib MODULE REQUIRED) find_package(fmt MODULE REQUIRED) -find_package(libiconv MODULE REQUIRED) + +if (APPLE) + find_package(Iconv MODULE REQUIRED) +else() + find_package(libiconv MODULE REQUIRED) + add_library(Iconv ALIAS libiconv::libiconv) +endif() # create a compilation database for e.g. clang-tidy set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -210,7 +216,7 @@ target_link_libraries(libFBX2glTF fmt::fmt libxml2::libxml2 zlib::zlib - libiconv::libiconv + Iconv ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} )