MantisBT - CMake
View Issue Details
0014164CMakeCMakepublic2013-05-22 13:252016-06-10 14:31
Stefan Roettger 
Mathieu Malaterre 
normalmajoralways
closedmoved 
Apple MacOS X10.4.10
CMake 2.8.11 
 
0014164: missing library in cmake-2.8/Modules/FindDCMTK.cmake
The FindDCMTK module finds various libs as part of DCTMK. The module finds all those in a for loop:

foreach(lib
    dcmdata
    dcmimage
    dcmimgle
    dcmjpeg
    dcmnet
    dcmpstat
    dcmqrdb
    dcmsign
    dcmsr
    dcmtls
    ijg12
    ijg16
    ijg8
    ofstd)

This loop is missing the "oflog" lib. oflog depends on ofstd, so it should read:

foreach(lib
    dcmdata
    dcmimage
    dcmimgle
    dcmjpeg
    dcmnet
    dcmpstat
    dcmqrdb
    dcmsign
    dcmsr
    dcmtls
    ijg12
    ijg16
    ijg8
    oflog
    ofstd)
linkage against dcmtk 3.6.0 fails.
An example project that depends on dcmtk is available at http://code.google.com/p/vvv/source/browse/#svn%2Fviewer%2Fqtv3 [^]

This one works because I added the linkage with dcmtk manually. I mean, adding -loflog to the linker line manually solves the problem.

Using find_package(DCMTK) and linking against DCMTK_LIBRARIES does result in unresolved symbols because oflog is not part of DCMTK_LIBRARIES (yet ;-).
No tags attached.
Issue History
2013-05-22 13:25Stefan RoettgerNew Issue
2013-05-22 13:30Brad KingAssigned To => Mathieu Malaterre
2013-05-22 13:30Brad KingStatusnew => assigned
2013-05-22 13:39Jean-Christophe Fillion-RobinNote Added: 0033112
2013-05-22 13:45Brad KingNote Added: 0033113
2013-05-22 15:23Jean-Christophe Fillion-RobinNote Added: 0033114
2013-05-24 19:33Stefan RoettgerNote Added: 0033131
2016-06-10 14:28Kitware RobotNote Added: 0042287
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0033112)
Jean-Christophe Fillion-Robin   
2013-05-22 13:39   
For reference: An updated version of the FindDCMTK.cmake module is available here: https://github.com/commontk/CTK/blob/master/Utilities/CMake/FindDCMTK.cmake [^]

It has been updated to be able to find the library associated with the latest version of DCMTK. Not DCMKT has been CMake'ified, it is also able to find libraries associated with a build or install tree of DCMTK.

I am sure it would be helpful if you could check that this updated module works within your application.
(0033113)
Brad King   
2013-05-22 13:45   
Assigned to Mathieu, current FindDCMTK maintainer:

 http://www.cmake.org/Wiki/CMake:Module_Maintainers [^]

Fortunately upstream DCMTK is learning to provide a CMake package configuration file:

 http://git.dcmtk.org/web?p=dcmtk.git;a=commitdiff;h=06c91303 [^]

after which "find_package(DCMTK NO_MODULE)" will work without any find module.
(0033114)
Jean-Christophe Fillion-Robin   
2013-05-22 15:23   
And they should be integrating soon the following commit :) https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9 [^]
(0033131)
Stefan Roettger   
2013-05-24 19:33   
As Jean-Christophe Fillion-Robin suggested I tried the updated cmake module.

This one includes the oflog library. Hence, it worked for my project. Good!

There are few quirks remaining, though. Those most likely have to be resolved upstream, but I do not know who is responsible, so I post it here hoping that somebody forwards it ;-)

1) dcmtk installs to /usr/local by default (at least on my mac when running "make install") but it does not find dcmtk at that standard location, because it inconsistently assumes the standard location to be /usr, which is odd. The work-around is to set DCMTK_DIR to /usr/local. Then find_package(DCMTK) works out-of-the-box.
   It would be better to locate dcmtk in standard directories like /usr _AND_ /usr/local if DCMTK_DIR is _NOT_ set.

2) I have to define HAVE_CONFIG_H manually. Otherwise I was not able to make my application compile with dcmtk. I do not see a sound reason why a library should require such a define when using a plain standard installation. It should be working without that! That's like a car with pedals swapped.

3) While the new dcmtk cmake module works, the packaged cmake module in cmake 2.8.11 is broken for sure. I'd suggest to either remove it completely from the cmake package or just add "oflog" to the loop to fix it until it is replaced with the new upstream version. Otherwise there will be other developers wasting time on finding out that it won't work with the actual dctmk version.

Thanks for your help and the quick replies!
Stefan
(0042287)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.