[ITK] How do I generate the ITKMorpholigical library?

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Jan 28 14:37:33 EST 2015


Hello,

The header file reside in the source directory of ITK[1], and does not need to be moved to the build directory where object files and libraries are created during the build process.

When the INSTALL target is run on the ITK project, all the libraries, cmake interface files along with the header, and template header files are copied to the specified installation directory.

When you use ITK with CMake, and find and include the ITK cmake[2] files, it will automatically add the correct include paths to the compiler for all the ITK files available for either of the above cases.

Does that explanation help?
Brad


[1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.h
[2] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/CMakeLists.txt#L5-L6

On Jan 28, 2015, at 2:21 PM, Andy Diamond <adiamondcsi at gmail.com> wrote:

> Hi Matt, Brat, et. al.,
> I'm still confused. Sorry for being dense.  
> 
> Let me try this another way. Below is the start of a definition of a template class (in some header file I would think)
> template <class A_Type> class calc
> ....
> 
> and here's a corresponding instantiation in some C++ file (.cpp)
> calc <double> a_calc_class;
> How does compiler  know what what the Identifier/type "calc" is?  Doesn't it have to include the header with the definition so it doesn't come back with an error message of " 'calc' is an unknown identifier" or the like?
> 
> Of course, given such a header file, if I searched its directory for the string "calc" the search would at least return that header file as a file that contains "calc".  
> 
> None of this seems to be the case with the class "GrayscaleFillholeImageFilter"
> 
> Thanks,
> Andy
> 
> On Wed, Jan 28, 2015 at 7:00 AM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> Hi,
> 
> For the IDE project generators, we already add the header files to the
> projects so they will show up in the IDE [1]. But, there is still
> nothing to build for a header-only module and no .lib file will be
> generated.
> 
> HTH,
> Matt
> 
> [1] http://itk.org/gitweb?p=ITK.git;a=blob;f=CMake/ITKModuleMacros.cmake;h=c32a29eda33a0af9b7301d55e14d07567cc6f00f;hb=HEAD#l81
> 
> On Wed, Jan 28, 2015 at 8:55 AM, Bradley Lowekamp
> <blowekamp at mail.nih.gov> wrote:
> > Matt,
> >
> > Isn't there some CMake option to "add" header and template headers files to targets? The properties/option I recall reading said it only effected how the files where displaced in an IDE.
> >
> > Perhaps this is what Andy was expecting? To see the headers as part of the project some place?
> >
> > Brad
> >
> > On Jan 27, 2015, at 11:19 PM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> >
> >> Hi Andy,
> >>
> >>> 1) Why didn't my search for GrayscaleFillholeImageFilter find anything say in a header file? are they pre compiled?
> >>
> >> The header files are not pre-compiled.  When you build your executable
> >> and specify the types you want to use in the template, the compiler
> >> generates the appropriate code.
> >>
> >>> 2) Do you know how I can build just that test and example ( in msvc 11).  Do I have to run cmake-gui all over again with the option checked for all the example and tests?  Then what project would I need to build in msvc?  I certainly don't want to build all the tests and examples as that takes forever
> >>
> >> Yes, the options must be enabled in CMake -- it is all or nothing.
> >> Try some of the Sphinx Examples (see the link to the .zip file in the
> >> left column), to build just an individual example [1].
> >>
> >> HTH,
> >> Matt
> >>
> >> [1] http://itk.org/ITKExamples/src/Filtering/MathematicalMorphology/DilateAGrayscaleImage/Documentation.html
> >>
> >> PS.  Please keep messages on the list so all can benefit.
> >>
> >>
> >>>
> >>> thanks,
> >>> Andy
> >>> Sent from my iPhone
> >>>
> >>>> On Jan 27, 2015, at 7:13 PM, Matt McCormick <matt.mccormick at kitware.com> wrote:
> >>>>
> >>>> Hi Andy,
> >>>>
> >>>> Yes, since that module only contains templated headers, there is
> >>>> nothing to build.  If BUILD_TESTING is ON, then the tests for that
> >>>> module would be built.
> >>>>
> >>>> HTH,
> >>>> Matt
> >>>>
> >>>>> On Tue, Jan 27, 2015 at 8:26 PM, Andy Diamond <adiamondcsi at gmail.com> wrote:
> >>>>> I followed instructions in
> >>>>> http://www.itk.org/Wiki/ITK/Configuring_and_Building/VisualStudio but I'm
> >>>>> using Studio 12 (which is VC11?).
> >>>>>
> >>>>> I used cmake GUI, which seemed to generate all the visual studio projects.
> >>>>> Note, to save time, as per the recommendations in the above link, I didn't
> >>>>> generate the test or examples. I loaded ITK.SLN, from the top level of
> >>>>> cmake-guis target, into VS and it ran saying it had no errors.
> >>>>>
> >>>>> However, when I go to where it generate the libs there is no
> >>>>> ITKMathematicalMorphology.lib.
> >>>>>
> >>>>> One of the projects listed in Visual Studio is
> >>>>> ITKMathematicalMorphology-all. It apparently has no source code (the
> >>>>> ITKMathematicalMorphology-all project has no Source Files section).
> >>>>> According to ITKs That library has a function (or whatever) called
> >>>>> GrayscaleFillholeImageFilter but there is no file in the entire build
> >>>>> directory tree (cmake-gui's target) with that string.
> >>>>>
> >>>>> Even if it's all somehow templated away, shouldn't some header or whatever
> >>>>> file have GrayscaleFillholeImageFilter(otherwise what does it mean to list
> >>>>> it)
> >>>>>
> >>>>> Thanks
> >>>>>
> >>>>> _______________________________________________
> >>>>> Community mailing list
> >>>>> Community at itk.org
> >>>>> http://public.kitware.com/mailman/listinfo/community
> >>>>>
> >> _______________________________________________
> >> Community mailing list
> >> Community at itk.org
> >> http://public.kitware.com/mailman/listinfo/community
> >
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150128/334cdf70/attachment.html>


More information about the Community mailing list