[Insight-users] Problem building examples

Luis Ibanez luis.ibanez at kitware.com
Sat Jul 29 17:29:13 EDT 2006


Hi Rick,

The Examples are configured to be build as part of the same source tree
of the Toolkit.

The HelloWorld example in the Examples/Installation directory is
  the *only* example intended to be build from outside of the toolkit.

Please read the Tutorials

      http://www.itk.org/HTML/Tutorials.htm


and the ITK Software Guide


      http://www.itk.org/ItkSoftwareGuide.pdf


You will find instruction on how to write or modify a CMakeLists.txt
file in order to make it find where you have built ITK.

It comes down to adding the following lines to the CMakeLists.txt file


               FIND_PACKAGE(ITK REQUIRED)
               IF(ITK_FOUND)
                  INCLUDE(${ITK_USE_FILE})
               ENDIF(ITK_FOUND)


Please *DO NOT* waste your time trying to include the many directories
of ITK in the little text boxes for include directories in the IDE of
Visual Studio. You should never need to modify the projects generated
by CMake. All changes should be made at the level of the CMakeLists.txt
file.


     Regards,



         Luis



------------------
Rick Giuly wrote:
> Hello,
> 
> I'm using CMake to generate a Visual Studio 2003 .NET sln file from the 
> ITK/Examples/CMakelists.txt file. When I try to build I get many of the 
> "no such file" errors for .h files (example shown at the bottom of this 
> message).
> 
> I noticed that when I tried the HelloWorld example from the 
> documentation, somehow the VS project knew where the .h files were and 
> had no problem generating them. I suppose that is because of the way 
> that the CMakelists.txt for the HellowWorld application is written. Is 
> there some reason that the CMakelists.txt file in ITK/Examples doesn't 
> specify where the .h files are, or does it?
> 
> I did try including all of the .h directories by hand 
> (Tools/Options/...) although I assume this shouldn't be necessary, and 
> it actually ends up generating a bunch of different errors anyway.
> 
> 
> Any help will be appreciated.
> 
> -Rick
> 
> 
> ------ Build started: Project: RegistrationExamplesO2, Configuration: 
> Debug Win32 ------
> 
> Compiling...
> RegistrationExamplesO2.cxx
> RegistrationExamplesO2.cxx(30) : fatal error C1083: Cannot open include 
> file: 'vnl/vnl_sample.h': No such file or directory
> 
> Build log was saved at 
> "file://c:\InsightToolkit-2.8.1\Examples\Registration\RegistrationExamplesO2.dir\Debug\BuildLog.htm" 
> 
> RegistrationExamplesO2 - 1 error(s), 0 warning(s)
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 




More information about the Insight-users mailing list