[Insight-users] trouble setting ITK_DIR : cannot find itkImage.h

David Doria daviddoria at gmail.com
Sun Jun 10 10:26:37 EDT 2012


On Sun, Jun 10, 2012 at 10:10 AM, Pratik Talole <pratiktalole at gmail.com>wrote:

> David,
>
> I was following these instructions by Luis Ibanez:
>
> "Hi Sebastian,
> Yes, it is very easy to create a static library.
> Simply write the following commands in the CMakeLists.txt
> file of your project:
>    ADD_LIBRARY( MyLibraryName STATIC
>       sourcefile1.cxx
>       sourcefile2.cxx
>       sourcefile3.cxx
>        )
>    TARGET_LINK_LIBRARIES( MyLibraryName  ITKCommon )
> The "STATIC" modifier is not really necessary, since it is
> the default option anyways."
>
> I tried this :
> TARGET_LINK_LIBRARIES( MyLibraryName  ${ITK_LIBRARIES} )
>
> instead of this:
> TARGET_LINK_LIBRARIES( MyLibraryName  ITKCommon )
>
> I still get the error : 'itkImage.h': No such file or directory
>
> Thanks
>
> Pratik
>

Those must be very old instructions. If you are using ITK4, you should
always link to ${ITK_LIBRARIES} .

You should not set this manually in the CMakeLists.txt:
SET (ITK_DIR   F:\ITK_jun1\bin)

but rather set it using the CMake GUI when you generate your program.

This is the important line for setting up the include
path: include(${ITK_USE_FILE}), so since you have it, I'm not sure what
else is wrong. Try setting your ITK_DIR in the cmake gui and regenerating
your project.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120610/33003c08/attachment.htm>


More information about the Insight-users mailing list