vcpkg/ports/exiv2/use-iconv.patch

38 lines
1.1 KiB
Diff
Raw Normal View History

2018-02-24 15:36:52 +08:00
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>