[ITK-users] [ITK] Exception when running IO example ImageReadCastWrite in Xcode

Matt McCormick matt.mccormick at kitware.com
Mon Mar 31 09:59:07 EDT 2014


Hi Ramon,

On Mon, Mar 31, 2014 at 3:41 AM, padillr <ramonpadilla1 at yahoo.co.uk> wrote:
> Hi Matt,
>
> Thanks for your reply.
>
>>> Use CMake to generate the XCode project for the HelloWorld or
>>> ImageReadCastWrite, and it will automatically generate all the
>>> factories.
>
> Why do I need to do this?
>
> Ultimately I would like to use the ITK libraries in my application by
> including the appropriate ITK headers and linking to the appropriate ITK
> binaries from my existing Xcode project. I don't want to have to generate
> Xcode projects using CMake for that?
>
> Are you saying that isn't feasible?

It can be done, but it is highly not recommended.


>>> Yes, the CMake generate XCode or Makefiles are different.  With the
>>> CMake generated project, it will create a directory in your build
>>> directory called "ITKIOFactoryRegistration".  This contains the
>>> generated header files that do the factory registration automatically.
>>>  The have to be created at CMake configure time because they depend on
>>> which ITK IO modules were enabled.
>
> What determines which ITK IO modules are enabled?

The ITK modules selected when ITK is configured with CMake.

>
> Is it not possible to build the libraries using CMake and then just use them
> without having to use CMake to build whatever uses them?

Again, it is possible, but it is discouraged.  CMake is designed to
work with all build generators, including XCode.  There are other
advantages to using CMake to generate your XCode project.  It saves
many headaches when upgrading to a new XCode version.

Thanks,
Matt


More information about the Insight-users mailing list