[ITK Community] [Insight-users] [Insight-developers] ITK's FindDCMTK.cmake cannot assign the correct DCMTK linking libraries accounding to build type

Mengda Wu wumengda at gmail.com
Sat Dec 14 17:08:32 EST 2013


Thanks a lot for the reply!

I am using USE_SYSTEM_DCMTK and an externally built DCMTK (latest git
version) on Windows visual studio 2012. There is no problem
at all for compiling ITK and ITK-based applications. There is just some
warnings when trying to link under Debug build type. What I found is
the linking libraries related to DCMTK in CMake's ITK_LIBRARIES variable
does not differentiate debug and release. For example, the ITK_LIBRARIES
variable has something like
D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmsr.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmsr.lib;

To compare, ITKDCMTK_LIBRARIES variable has
optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmsr.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmsr.lib;
which could be used in TARGET_LINK_LIBRARIES command and should be able to
solve the issue.

For the details for these variables, please see my previous email.

So I can help if you point to me where those "optimized" and "debug"
keywords get lost when converting ITKDCMTK_LIBRARIES to ITK_LIBRARIES. I
may be able to help.

Thanks,
Mengda


On Thu, Dec 12, 2013 at 10:36 AM, Williams, Norman K <
norman-k-williams at uiowa.edu> wrote:

> The problem is that no one who is A) A CMake Guru B) A Windows User and C)
> Patient enough to navigate the inevitable frustrations involved has really
> attacked getting DCMT linking to ITK on Windows.
>
> As it stands now, you need to use USE_SYSTEM_DCMTK and an externally built
> DCMTK to use DCMTK with ITK on Windows.  And I never figured out all the
> business with different build types on Windows.  Compared with how it
> works on Linux/OS X/Unix it's a real mess on Windows.  And it basically
> never worked to build inside Visual Studio for me; I ended up doing
> command line builds.
>
> Any insight or actual work to try and resolve this would be very welcome.
> The problem is in Modules/ThirdParty/DCMTK/CMakeLists.txt: We didn't
> figure out how to get the various MSVC model stuff into the import/export
> stuff when building up the CMake infrastructure for importing ITK from a
> build or install directory.
>
>
> On 12/11/13 10:34 PM, "Mengda Wu" <wumengda at gmail.com> wrote:
>
> >Just to follow up.... I did a little printing of the CMake variables.
> >Here are the values for them. I am not sure why ITK_LIBRARIES throws away
> >the "optimized" and "debug" keyword in ITKDCMTK_LIBRARIES or
> >DCMTK_LIBRARIES.
> >
> >DCMTK_LIBRARIES:
> >optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmpstat.lib;debug;D:/L
> >ibrary/DCMTK/dcmtk/Build/lib/Debug/dcmpstat.lib;optimized;D:/Library/DCMTK
> >/dcmtk/Build/lib/Release/dcmsr.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/
> >Debug/dcmsr.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmtls.
> >lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmtls.lib;optimized;D:/L
> >ibrary/DCMTK/dcmtk/Build/lib/Release/dcmqrdb.lib;debug;D:/Library/DCMTK/dc
> >mtk/Build/lib/Debug/dcmqrdb.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib
> >/Release/dcmnet.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/
> dcmnet.li
> >b;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmjpeg.lib;debug;D:/
> >Library/DCMTK/dcmtk/Build/lib/Debug/dcmjpeg.lib;optimized;D:/Library/DCMTK
> >/dcmtk/Build/lib/Release/dcmimage.lib;debug;D:/Library/DCMTK/dcmtk/Build/l
> >ib/Debug/dcmimage.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/d
> >cmimgle.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmimgle.lib;opti
> >mized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmdata.lib;debug;D:/Librar
> >y/DCMTK/dcmtk/Build/lib/Debug/dcmdata.lib;optimized;D:/Library/DCMTK/dcmtk
> >/Build/lib/Release/oflog.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/
> >oflog.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/ofstd.lib;deb
> >ug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ofstd.lib;optimized;D:/Library/D
> >CMTK/dcmtk/Build/lib/Release/ijg12.lib;debug;D:/Library/DCMTK/dcmtk/Build/
> >lib/Debug/ijg12.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/ijg
> >16.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ijg16.lib;optimized;D:
> >/Library/DCMTK/dcmtk/Build/lib/Release/ijg8.lib;debug;D:/Library/DCMTK/dcm
> >tk/Build/lib/Debug/ijg8.lib;netapi32;wsock32
> >
> >
> >ITKDCMTK_LIBRARIES:
> >optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmpstat.lib;debug;D:/L
> >ibrary/DCMTK/dcmtk/Build/lib/Debug/dcmpstat.lib;optimized;D:/Library/DCMTK
> >/dcmtk/Build/lib/Release/dcmsr.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/
> >Debug/dcmsr.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmtls.
> >lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmtls.lib;optimized;D:/L
> >ibrary/DCMTK/dcmtk/Build/lib/Release/dcmqrdb.lib;debug;D:/Library/DCMTK/dc
> >mtk/Build/lib/Debug/dcmqrdb.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib
> >/Release/dcmnet.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/
> dcmnet.li
> >b;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmjpeg.lib;debug;D:/
> >Library/DCMTK/dcmtk/Build/lib/Debug/dcmjpeg.lib;optimized;D:/Library/DCMTK
> >/dcmtk/Build/lib/Release/dcmimage.lib;debug;D:/Library/DCMTK/dcmtk/Build/l
> >ib/Debug/dcmimage.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/d
> >cmimgle.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmimgle.lib;opti
> >mized;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmdata.lib;debug;D:/Librar
> >y/DCMTK/dcmtk/Build/lib/Debug/dcmdata.lib;optimized;D:/Library/DCMTK/dcmtk
> >/Build/lib/Release/oflog.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/
> >oflog.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/ofstd.lib;deb
> >ug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ofstd.lib;optimized;D:/Library/D
> >CMTK/dcmtk/Build/lib/Release/ijg12.lib;debug;D:/Library/DCMTK/dcmtk/Build/
> >lib/Debug/ijg12.lib;optimized;D:/Library/DCMTK/dcmtk/Build/lib/Release/ijg
> >16.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ijg16.lib;optimized;D:
> >/Library/DCMTK/dcmtk/Build/lib/Release/ijg8.lib;debug;D:/Library/DCMTK/dcm
> >tk/Build/lib/Debug/ijg8.lib;netapi32;wsock32
> >
> >
> >
> >
> >ITK_LIBRARIES:
> >itkdouble-conversion;itksys;itkvnl_algo;itkvnl;itkv3p_netlib;ITKCommon;itk
> >NetlibSlatec;ITKStatistics;ITKIOImageBase;ITKMesh;itkzlib;ITKMetaIO;ITKSpa
> >tialObjects;ITKPath;ITKLabelMap;ITKQuadEdgeMesh;ITKOptimizers;ITKPolynomia
> >ls;ITKBiasCorrection;ITKBioCell;optimized;D:/Library/DCMTK/dcmtk/Build/lib
> >/Release/dcmpstat.lib;debug;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmpsta
> >t.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmsr.lib;D:/Library/DCMTK/
> >dcmtk/Build/lib/Debug/dcmsr.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/d
> >cmtls.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmtls.lib;D:/Library/DCM
> >TK/dcmtk/Build/lib/Release/dcmqrdb.lib;D:/Library/DCMTK/dcmtk/Build/lib/De
> >bug/dcmqrdb.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmnet.lib;D:/Lib
> >rary/DCMTK/dcmtk/Build/lib/Debug/dcmnet.lib;D:/Library/DCMTK/dcmtk/Build/l
> >ib/Release/dcmjpeg.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmjpeg.lib;
> >D:/Library/DCMTK/dcmtk/Build/lib/Release/dcmimage.lib;D:/Library/DCMTK/dcm
> >tk/Build/lib/Debug/dcmimage.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/d
> >cmimgle.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/dcmimgle.lib;D:/Library
> >/DCMTK/dcmtk/Build/lib/Release/dcmdata.lib;D:/Library/DCMTK/dcmtk/Build/li
> >b/Debug/dcmdata.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/oflog.lib;D:/
> >Library/DCMTK/dcmtk/Build/lib/Debug/oflog.lib;D:/Library/DCMTK/dcmtk/Build
> >/lib/Release/ofstd.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ofstd.lib;D:
> >/Library/DCMTK/dcmtk/Build/lib/Release/ijg12.lib;D:/Library/DCMTK/dcmtk/Bu
> >ild/lib/Debug/ijg12.lib;D:/Library/DCMTK/dcmtk/Build/lib/Release/ijg16.lib
> >;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ijg16.lib;D:/Library/DCMTK/dcmtk/B
> >uild/lib/Release/ijg8.lib;D:/Library/DCMTK/dcmtk/Build/lib/Debug/ijg8.lib;
> >netapi32;wsock32;ITKDICOMParser;ITKEXPAT;ITKIOXML;ITKIOSpatialObjects;ITKF
> >EM;itkopenjpeg;gdcmDICT;gdcmMSFF;ITKznz;ITKniftiio;ITKgiftiio;itkhdf5_cpp;
> >itkhdf5;ITKIOBMP;ITKIOBioRad;ITKIOCSV;ITKIODCMTK;ITKIOGDCM;ITKIOIPL;ITKIOG
> >E;ITKIOGIPL;ITKIOHDF5;itkjpeg;ITKIOJPEG;itktiff;ITKIOTIFF;ITKIOLSM;ITKIOMR
> >C;ITKIOMesh;ITKIOMeta;ITKIONIFTI;ITKNrrdIO;ITKIONRRD;itkpng;ITKIOPNG;ITKIO
> >Siemens;ITKIOStimulate;ITKIOTransformBase;ITKIOTransformHDF5;ITKIOTransfor
> >mInsightLegacy;ITKIOTransformMatlab;ITKIOVTK;ITKKLMRegionGrowing;ITKVTK;IT
> >KWatersheds;ITKReview;ITKVideoCore;ITKVideoIO;ITKVtkGlue
> >
> >
> >
> >
> >
> >Thanks,
> >
> >Mengda
> >
> >
> >
> >
> >On Wed, Dec 11, 2013 at 11:12 PM, Mengda Wu
> ><wumengda at gmail.com> wrote:
> >
> >Hi all,
> >
> >
> >   I found there is a recent update in the git version of
> >Modules\ThirdParty\DCMTK\CMake\FindDCMTK.cmake. Although it fixes the
> >issue of the one shipped with CMake install. This version still has a
> >problem.
> >
> >
> >
> >   It cannot assign the correct DCMTK linking libraries accounding to
> >build type. So for both debug and release build of my own application, in
> >my cmake generated vc projects settings, I saw both the DCMTK debug and
> >release libraries are in my Linker->Input->Additional
> > Dependencies.
> >
> >
> >  Why is that?
> >
> >
> >Thanks,
> >
> >Mengda
> >
> >
> >
> >
> >
> >
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
>  Please reply to the sender that you have received the message in error,
> then delete it.  Thank you.
> ________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131214/6d23dd1a/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list