[Insight-users] Using ITK with visual studio and not cmake

Luis Ibanez luis.ibanez at kitware.com
Wed Oct 21 18:35:17 EDT 2009


Hi Mark,


On Mon, Oct 19, 2009 at 3:00 PM, Mark Roden <mmroden at gmail.com> wrote:
> How about this:
>
> Is there a way to include everything into a monolithic dll such that I
> only need one header file instead of an entire tree?  There's already
> just the option to build the library, and it puts everything into one
> dll and many libs, but I still need to go through all of these hoops.
>
> Mark
-------------------------------------------------------------------------------


You seem to be under estimating the size of ITK,
and its Generic Programming nature.


1) ITK's source code proper is:

                 175,394 lines of code

    which includes 984 templated classes.

    (this is the source code under Insight/Code)


    All this code doesn't make it into any of the ITK libraries that
    you build when you compile the toolkit.

    The same way that you don't have an STL library (in object code),
    you don't get most of ITK into the libraries.

    The ITK libraries such as ITKCommon, ITKIO, ITKNumerics only
    contain the non-templated classes of the toolkit, which are only
    287, and mostly relate to the infrastructure components, not the
    algorithmic components.


2) Including all this code in to a single header is... just not possible.

    Some versions of Visual Studio have already problems digesting
    the sequence of header inclusions in ITK....


3) Here is a practical solution that will take care of your pains:

    A) Build ITK and install it in a destination directory.
        (let's call that directory "InstalledDir" to simplify below)

        After the installation, all the binary libraries will be placed
        in a single directory:

                    InstalledDir/lib/InsightToolkit

     B) Go to the InstalledDir and run the command

             find InstalledDir/include/InsighToolkit -name "*.h" cp {}
InstalledDir/include/InsighToolkit ';'

          in less than one minute all the header files will be copied to the
          directory "InstalledDir/include", and you could put that single
          directory in the include path of Visual Studio.

          This of course, assumes that you have a Cygwin or MinGW
          installation in your computer....

          There are probably many ways of doing the equivalent with Python
           (using the glob command), or Perl,... or maybe with Windows native
          functionalities.



          If you added the feature request to the MANTIS bug tracker
          for modifying the ITK installation process we could attempt
          to do this for a future release of ITK.



    Regards,



          Luis


More information about the Insight-users mailing list