[exiv2] Fix FindIconv

This commit is contained in:
Robert Schumacher 2018-02-23 23:36:52 -08:00
parent 2f25ab678a
commit 451c6a8026
3 changed files with 44 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Source: exiv2
Version: 8f5b795eaa4bc414d2d6041c1dbd1a7f7bf1fc99-1
Build-Depends: zlib, expat
Version: 8f5b795eaa4bc414d2d6041c1dbd1a7f7bf1fc99-2
Build-Depends: zlib, expat, libiconv
Description: Image metadata library and tools http://www.exiv2.org

View File

@ -13,6 +13,11 @@ vcpkg_configure_cmake(
PREFER_NINJA
)
vcpkg_apply_patches(
SOURCE_PATH "${SOURCE_PATH}"
PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-iconv.patch"
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/exiv2/cmake")

View File

@ -0,0 +1,37 @@
diff --git a/config/FindIconv.cmake b/config/FindIconv.cmake
index 15a0e39..53718bf 100644
--- a/config/FindIconv.cmake
+++ b/config/FindIconv.cmake
@@ -36,12 +36,13 @@ if(NOT ICONV_INCLUDE_DIR STREQUAL "ICONV_INCLUDE_DIR-NOTFOUND")
endif()
if(NOT ICONV_IN_GLIBC)
- find_library(ICONV_LIBRARY NAMES iconv)
+ find_library(ICONV_LIBRARY NAMES iconv libiconv)
set(ICONV_TEST ${ICONV_LIBRARY})
else()
set(ICONV_TEST "In glibc")
endif()
+set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
check_cxx_source_compiles(
"#include <iconv.h>
@@ -59,7 +60,8 @@ else(ICONV_FOUND)
set(ICONV_LIBRARIES)
endif(ICONV_FOUND)
-if(ICONV_FOUND)
+if(ICONV_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
check_cxx_source_compiles(
"#include <iconv.h>
@@ -69,6 +71,7 @@ if(ICONV_FOUND)
}"
ICONV_ACCEPTS_NONCONST_INPUT)
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
check_cxx_source_compiles(
"#include <iconv.h>