[CMake] FindDCMTK Not setting up DCMTK_INCLUDE_DIRECTORIES Correctly?

kent williams nkwmailinglists at gmail.com
Tue Nov 29 12:19:00 EST 2011


I actually install DCMTK in a subdirectory of my top-level build, and
then my program that uses DCMTK is configured with DCMTK_DIR.

The problem isnt MY source, the problem is that the DCMTK headers use
the dcmtk/x/y.h path form to include OTHER DCMTK headers.

I am doing exactly what you're doing, and if you don't have this
problem I'm interested in how you got it to work.

While I'm whining -- FindDCMTK.cmake doesn't include liboflog.a in
DCMTK_LIBRARIES either.



On Tue, Nov 29, 2011 at 10:47 AM, Thomas Sondergaard
<ts at medical-insight.com> wrote:
> On 2011-11-29 17:28, kent williams wrote:
>>
>> I'm running into problems using the DCMTK library.  I've set up an
>> ExternalProject to build and install it, and the CMake 2.8.5
>> FindDCMTK.cmake finds the library if I set DCMTK_DIR.
>>
>> But the DCMTK_INCLUDE_DIRS variable created by FindDCMTK.cmake isn't
>> 100% correct.  It does a good job of enumerating all the include
>> directories, but the include files themselves have the bad manners to
>> use #include statements like this:
>>
>> #include "dcmtk/config/osconfig.h"
>>
>> Which would mean that ${prefix}/include should be added to
>> DCMTK_INCLUDE_DIRS
>>
>> ${prefix}/include/dcmtk/config
>> ${prefix}/include/dcmtk/dcmdata
>> ${prefix}/include/dcmtk/dcmimage
>> ${prefix}/include/dcmtk/dcmimgle
>> ${prefix}/include/dcmtk/dcmjpeg
>> ${prefix}/include/dcmtk/dcmnet
>> ${prefix}/include/dcmtk/dcmpstat
>> ${prefix}/include/dcmtk/dcmqrdb
>> ${prefix}/include/dcmtk/dcmsign
>> ${prefix}/include/dcmtk/dcmsr
>> ${prefix}/include/dcmtk/dcmtls
>> ${prefix}/include/dcmtk/ofstd
>> ${prefix}/include/dcmtk
>
>
> If the source has #include "dcmtk/config/osconfig.h" then it will not help
> you to have ${prefix}/include/dcmtk/config in the search path, you need to
> have ${prefix}/include.
>
>
>> Or am I doing something dumb?
>
>
> That's probably a bit strong.
>
> Why don't you try some modern printf-style debugging? :-) Modify the
> FindDCMTK.cmake file with some message(...) calls and see what is going on?
>
> I use FindDCMTK.cmake, but I use it against an installation directory nor
> against a source directory. The installation directory is created by dcmtk
> when building the install target. I use the cmake tool chain for dcmtk as
> well. The macro is supposed to work against both source and installation
> trees.
>
> Regards,
>
> Thomas
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list