[Insight-developers] passing include dirs and libs list through

Alexandre GOUAILLARD agouaillard at gmail.com
Sat May 14 07:31:50 EDT 2011


dear brad,

I hope you can help me on this matter. I m working on GDCM, and the
first step is to have itk compile with SYSTEM_GDCM. Here i m using an
installed version of gdcm, cloned and compiled from:
https://github.com/ComplexSystemsModeling/GDCM
I'm using windows XP 64, with MSVC 10, cmake 2.8.4.
I compile in static, 32 bits, debug.

my understanding is that external library using cmake should define
some variables, among which:
<name>_LIBRARIES
<name>_LIBRARY_DIRS
<name>_INCLUDE_DIRS

then on ITK side, those should be copied over to ITK-<name>_LIBRARIES
for example.

First it seems that GDCMConfig.cmake does not export the library list correctly
in GDCMConfig.cmake it gives:
SET(GDCM_LIBRARIES "")
I haven't figured out why the list is empty yet.

then, in ITK,  In the case of GDCM, this is not happening, and the
list of librairies are hardcoded in
Modules/ThirdParty/GDCM/CMakeList.txt
Can you confirm that we are suppose to copy over the list to
ITK-GDCM_LIBRARIES and that some cmake magic will take care of using
those when needed?

Now, let's say I hardcode the good list anyway, more errors are waiting for me.

If I compile ITK, I get 300+ errors, all linking errors as libs are
not found. The name is right, the file exists on disk, but it looks
like the directory where the files are is searched.
If I manually add the dir path in the project configuration
(additional link directory) it works.
My understanding (here, again, confirm or inform please, i m out of my
comfort zone) is that link_directories() is the cmake function to do
that, and that we should use the "GDCM_LIBRARY_DIRS" for that. Or at
list it was...
If I look in other third party module for inspiration, they do not
seem to use it (but then, there is no build using windows with systems
libs on the dashboard, so who knows if it works).
if I grep link_directories, it does not appear to be used.
- should this variable be copied to the ITK-... equivalent?
- would the modularization take care of it?
what's the process here to let ITK know where to find the libs?

Then of course, on gdcm side, GDCM_INCLUDE_DIRS is computed, and has
the correct value, but GDCM_LIBRARY_DIRS is never set in the
GDCMConfig.cmake, but that's another story.

What am I missing here?

Any help is appreciated.

thanks in advance, I've been banging my head against the wall for two
full days on that.

alex.


More information about the Insight-developers mailing list