From c62c11ee72d40ba859552390dd4e5dbc7dc6986d Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sun, 22 May 2022 04:09:18 +0200 Subject: [PATCH] Add include path for and link against Iconv `src/util/File.cpp` calls iconv_open(3) unconditionally on (!WIN && !MAC && !ANDROID). Thus all UNIX platforms will use iconv. On OpenBSD, the build immediately fails because `` is not in the default include path. Signed-off-by: Klemens Nanni --- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83130e165..5d6623182 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,9 @@ if(UNIX AND NOT APPLE) find_package(PkgConfig) pkg_check_modules(MINIZIP minizip IMPORTED_TARGET) endif() +if(NOT WIN32 AND NOT APPLE AND NOT ANDROID) + find_package(Iconv REQUIRED) +endif() find_package(SWIG) find_package(JNI) find_package(Python3 COMPONENTS Interpreter Development) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 98119464a..4400bf8ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,6 +171,10 @@ target_include_directories(digidocpp_priv PUBLIC ${XSD_INCLUDE_DIR} ) +target_link_libraries(digidocpp_util + Iconv::Iconv +) + target_link_libraries(digidocpp_priv digidocpp_util XmlSecurityC::XmlSecurityC