I am wondering if anyone has succeeded in compiling v3.6.3 with "iconv" under mingw64 (windows) + CMake? Actually I never succeeded before (v3.6.0, .1, .2)
The iconv header and library file seem to be available within mingw64:
"C:\mingw64\x86_64-w64-mingw32\include\iconv.h"
"C:\mingw64\x86_64-w64-mingw32\lib\libiconv.a"
I have been trying to set LIBICONV_INCLUDE_DIR, LIBICONV_LIBRARY, LIBICONV_LIBDIR in different ways in CMake but they simply cannot be found:
Here is how the original dcmtk-3.6.3\CMake\FindICONV.cmake looks like:Could NOT find LIBICONV (missing: LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR)
Could NOT find LIBCHARSET (missing: LIBCHARSET_LIBRARY LIBCHARSET_INCLUDE_DIR)
Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.
Anyone mind sharing with your successful settings? Thanks!INCLUDE(FindPackageHandleStandardArgs)
INCLUDE(dcmtkTryCompile)
# Look for the header file
FIND_PATH(LIBICONV_INCLUDE_DIR NAMES iconv.h)
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR)
# Look for the library
SET(LIBICONV_LIBS iconv)
FIND_LIBRARY(LIBICONV_LIBRARY NAMES ${LIBICONV_LIBS})
MARK_AS_ADVANCED(LIBICONV_LIBRARY)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBICONV REQUIRED_VARS LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR)
# Copy the result to output variables
IF(LIBICONV_FOUND)
SET(LIBICONV_LIBRARIES ${LIBICONV_LIBRARY})
SET(LIBICONV_INCLUDE_DIRS ${LIBICONV_INCLUDE_DIR})
ELSE(LIBICONV_FOUND)
SET(LIBICONV_LIBS)
SET(LIBICONV_LIBRARY)
SET(LIBICONV_LIBRARIES)
SET(LIBICONV_INCLUDE_DIR)
SET(LIBICONV_INCLUDE_DIRS)
ENDIF(LIBICONV_FOUND)