[Insight-developers] RE: Examples/GaussianFilter

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 11 Apr 2001 01:09:15 +0530


Luis,

The FIND_INCLUDE_DIR and FIND_LIBRARY_DIR command search the list of
directories listed similar to how configure searches for things.  You set up
the CMakeList.txt file so that it searches for Fltk in H:/usr/local/fltk.
When you build Fltk with project files in the visual_c directory, it does
not move the libraries anywhere.  So the path H:/usr/local/fltk is where
Fltk was installed on your system but on my system it is under
E:/fltk-1.0.10.  So CMake said "I can't find fltk" and marks the cache file
with NOTFOUND.  Not a big problem, since I can edit the cache file and CMake
honors the change.  However, your suggested path will probably only under
Windows.  So at a minimum, I would add the alternative directory
/usr/local/fltk to the include search list and /usr/local/fltk/lib to the
lib search list.

Now CMake does assume that the fltk libs would be filed under subdirectories
that match its build configurations (Debug, Release, ReleaseMinSize).  It
looks like Fltk just slaps a "d" on the end of the library name if is a
debug library (similar to what Microsoft does).  I made a series of
subdirectories under fltk/lib for Release and Debug and copied the
appropriate libraries into these subdirectories.

Thanks for checking in the missing files, I am closer to getting a build.  I
am now getting duplicate symbols from LIBCMT.lib and MSVCRT.lib. VC++ is
suggesting using the /NODEFAULTLIB library.  Did you have this problem?

Jim (still patiently waiting to see this example :)



-----Original Message-----
From: Luis Ibanez
To: Miller, James V (CRD)
Cc: Insight-developers (E-mail)
Sent: 4/10/2001 2:30 PM
Subject: Re: Examples/GaussianFilter

"Miller, James V (CRD)" wrote:
> I tried to build your example 


Glad to know that somebody tried !   :-)



> 
> First some comments on the README.
> 
> I build Fltk using the dsw in the visual_c directory of the download.
It built without issue.
> However, this method does not do any installation.  So you might want
to mention that when you run
> CMakeSetup, the include directory and lib directory for Fltk will be
marked NOTFOUND and that the
> user should edit the cache file that is presented.

Humm... 
What it means to mark them "NOTFOUND" ?
is that a CMake command ?
What I did is to add the FIND_INCLUDE_DIR and FIND_LIBRARY_DIR 
commands on the CMakeLists.txt files.
The problem I encounter with that is that CMake by default look
in to a "Debug" or "Release" directory, and fltk just use fltk/lib.


 
> It looks like step 2.2 of the README could be done on the 
> repository version of CMakeLists.txt.
> MetaImage is already listed in the SUBDIRS sections anyway. 

That sounds good to me, but MetaImage is essentially for I/O 
while FLTK is GUI.  I assume that the content of /Unsuported
will continue growing. Now we have :  vtk, vispack, MetaImage 
and FltkImageViewer.... and an user may want to use one of 
those independently of the others.



> Perhaps we need a standard way of putting these lines in the
> CMakeLists.txt file and commenting them out.  This would make 
> it easier for someone to add them to their builds since they 
> would only have to uncomment a line.  Or better yet, perhaps 
> a way to specify --with-GaussianFilter to configure and some 
> kind of gui for the windows to select whether these other
> systems should be built.

That will be great !
If CMake can in some way take care of that, it will simplify a 
lot the installation for programs that require unsupported and/or 
extra toolkits. 



> 
> It also looks like step 2.3 of the README could be done in the 
> repository version of CMakeLists.txt.
> Does IView belong under MetaImage?
> 

Well, maybe not, IView is in fact a viewer in itself, and
FltkImageViewer is using several of the classes in there,
specially SliceView and GlSliceView. Probably we could create 
an IView directory at the same level of MetaImage.


> Finally, the sticky points...
> 
> In building FltkImageViewer.lib, VC++ complains that fltkGlDrawer.h 
> cannot be found.  Are all the files checked into the repository?
>

Oops !
That's my mistake.  
Now is checked in. Sorry about that.
I have in fact a set of other files to check in the FltkImageViewer
directory, as soon as they are more stable.


> 
> Before I put FltkImageViewer in the CMakeLists.txt file, I was getting
a link error that
> GaussianFilter could not find MetaImageIO.lib or something like that.
So I suspect that there is a
> CMakeLists.txt file problem with GaussianFilter not listing all the
libraries that it needs (or where
> to find them).  However, I cannot reproduce this error now due to the
above compiler error in
> FltkImageViewer.

That's strange,

MetaImageIO.lib is the result of the CMakeList.txt in
/Unsupported/MetaImage.

It is indicated in GaussianFilter/CMakeList.txt:

- in LINK_LIBRARIES() as MetaImageIO
- in LINK_DIRECTORIES() the directory 
${ITK_BINARY_DIR}/Unsupported/MetaImage
- in INCLUDE_DIRECTORIES() the directory
${ITK_SOURCE_DIR}/Unsupported/MetaImage


Maybe I forgot to include it somewhere else ...
but this is working for me.






Thanks for trying the example.