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

Mark Roden mmroden at gmail.com
Mon Oct 19 12:56:33 EDT 2009


On Mon, Oct 19, 2009 at 9:35 AM, John Drescher <drescherjm at gmail.com> wrote:
>> I want to incorporate more libraries than just itk in my project, and
>> am having a pretty hard time of it.
>>
> I can tell you as a 12 year windows programmer before ever using
> CMake, its much much easier to do this with cmake. And also cmake
> actually a lot of benefit to visual studio. Out of source builds,
> built in unit testing, built in install generator, ability to have one
> project file for all versions of visual studio VC6+... Eventually I
> will convert all my old projects to use cmake and drop the .vsproj and
> .dsp files out of my cvs repository...

I have a similar level of experience here, and I'm just not that into
cmake.  I've learned quite a few tricks with sln files and the like,
and figuring out yet another set of build rules and yet another set of
unit testing paradigms and a different source control system (I use
either git or perforce, cvs just gives me hives) is a real distraction
from getting work done.

Let me put it this way: the CMake paradigm adopted by itk, that of
single files to accomplish a simple task, is fine for little command
line applications, but not how I want to build an application.  If I
wanted to incorporate other libraries (ie, QT for useful interfaces,
etc), trying to mesh these libraries with those will be most likely
excruciating.  That's why I'm looking for a simple build location,
with dlls, libs, and headers, not to incorporate with an entire coding
paradigm.

Maybe I don't understand CMake.  Frankly, I really don't want to.  I
just want to use the libraries as libraries, not as a coding style or
as a way to organize files.

>
>>
>> I've built the libraries using the cmake options to build only libraries.
>>
>> I then have a basic hello-world executable that links to the built
>> libraries and includes the itk/code/common directory.
>>
>> I then #include "itkImage.h" at the top of my main file, and have the
>> body of the main function matching the example from HelloWorld.cxx in
>> examples/installation
>>
>> When I try to build, I get this error:
>>
>> 1>c:\users\mark\src\itktests\itktestproject\itk
>> libraries\code\common\itkwin32header.h(23) : fatal error C1083: Cannot
>> open include file: 'itkConfigure.h': No such file or directory
>>
>> How do I fix this?  I can't find the itkConfigure.h file anywhere;
>> does cmake not make it automatically?
>>
> Yes, that should be inside the build tree. I have my ITK source at
>
> X:\CMakeBase\Libraries\ITK-3.16
>
> and the build tree at
>
> X:\32Bit\VC.80\Libraries\ITK-3.16
>
> and I can see a itkConfigure.h in that folder.

I've found it, and now I get:

1>c:\users\mark\src\itktests\itktestproject\itk
libraries\code\common\itkmacro.h(42) : fatal error C1083: Cannot open
include file: 'vnl/vnl_math.h': No such file or directory

vnl_math is not found in this directory structure.

More to the point, I really have no desire to chase down ten thousand
header files to make this work; I strongly suspect that once the
vnl_math.h problem gets fixed, then there's five others waiting in the
wings.  It's not at all clear to me why it is necessary to include
math libraries just to create a blank 3D image, but setting aside my
own ignorance, is there an easy way to get what I want, ie, just
linking to some monolithic directory that has all the itk libraries?
If not, if I wrote such a thing, would it be considered at all useful
by anyone else, or just the intransigence of one guy going against the
CMake trend?

And what about those warnings?

Thanks,
Mark


More information about the Insight-users mailing list