From 537094fd531e3a5cd039d25ec705b7a1e9e3ba02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= Date: Sat, 10 Oct 2020 15:20:19 +0200 Subject: [PATCH] =?UTF-8?q?use=20CMake=E2=80=99s=20FindIconv=20to=20detect?= =?UTF-8?q?=20iconv=20portably?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50ecd65..e0e4919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,10 @@ pkg_check_modules(OGG REQUIRED ogg) add_compile_options(${OGG_CFLAGS}) link_directories(${OGG_LIBRARY_DIRS}) +include(FindIconv) + configure_file(src/config.h.in config.h @ONLY) -include_directories(BEFORE src "${CMAKE_BINARY_DIR}" ${OGG_INCLUDE_DIRS}) +include_directories(BEFORE src "${CMAKE_BINARY_DIR}" ${OGG_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS}) add_library( ot @@ -30,11 +32,7 @@ add_library( src/opus.cc src/system.cc ) -target_link_libraries(ot PUBLIC ${OGG_LIBRARIES}) - -if (APPLE) - target_link_libraries(ot PUBLIC iconv) -endif() +target_link_libraries(ot PUBLIC ${OGG_LIBRARIES} ${Iconv_LIBRARIES}) add_executable(opustags src/opustags.cc) target_link_libraries(opustags ot)