<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi, OpenSceneGraph folks.<br>
    <br>
    I ran in to an issue while building OpenSceneGraph on Mac OS X the
    other day. DCMTK can be built with libiconv support, in which case
    any program linking in dcmtk will also need to link in libiconv. The
    OpenSceneGraph build script seems to assume that dcmtk was built
    without libiconv, so doesn't attempt to link it.<br>
    <br>
    <br>
    Originally found this through a report to Homebrew:<br>
    <br>
    <a class="moz-txt-link-freetext" href="https://github.com/Homebrew/homebrew/issues/46356">https://github.com/Homebrew/homebrew/issues/46356</a><br>
    <a class="moz-txt-link-freetext" href="https://github.com/Homebrew/homebrew/pull/46388">https://github.com/Homebrew/homebrew/pull/46388</a><br>
    <br>
    <br>
    Homebrew's dcmtk is always built with libiconv, so as a workaround
    we just hacked it to unconditionally link libiconv.<br>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <pre>
diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt
index 55c2a57..e6e3f4a 100644
--- a/src/osgPlugins/dicom/CMakeLists.txt
+++ b/src/osgPlugins/dicom/CMakeLists.txt
@@ -5,7 +5,7 @@ IF  (DCMTK_FOUND)

     SET(TARGET_SRC ReaderWriterDICOM.cpp )

-    LINK_LIBRARIES(${DCMTK_LIBRARIES} ${ZLIB_LIBRARY})
+    LINK_LIBRARIES(${DCMTK_LIBRARIES} iconv ${ZLIB_LIBRARY})

     ADD_DEFINITIONS(-DUSE_DCMTK)
</pre>
    <br>
    That won't work in general though; seems like the build script would
    need to query dcmtk to see if it used libiconv and detect libiconv's
    installation location as well. The dcmtk installation includes a
    lib/cmake directory with information on how dcmtk was built; that
    might be an easy way to get at it.<br>
    <br>
    Cheers,<br>
    Andrew Janke<br>
  </body>
</html>