Hi,<br><br>I have a problem linking an ITK class to my project. At first I build the binaries of ITK 3.20 and linked them to my project via CMAKE. What I did was:<br><br><br>FIND_PACKAGE(ITK)<br>IF(ITK_FOUND)<br>  INCLUDE(${ITK_USE_FILE})<br>
ELSE(ITK_FOUND)<br>  MESSAGE(FATAL_ERROR &quot;Cannot build without ITK. Please set ITK_DIR.&quot;)<br>ENDIF(ITK_FOUND)<br><br>SET(ITK_LIBS <br>  ITKAlgorithms<br>  ITKBasicFilters <br>  ITKCommon <br>  ITKIO <br>)        <br>
<br>LINK_LIBRARIES(${ITK_LIBS})<br><br><br>Everything works fine. I can compile my project with many ITK classes in use. But then I tried to use <br><br>#include &quot;itkImageKernelOperator.h&quot;<br><br>in my project. Unfortunatelly, the compiler (VS 2010) says:<br>
<br>fatal error C1083: Cannot open include file: &#39;itkImageKernelOperator.h&#39;: No such file or directory<br><br>I found out that the directory C:/Libs/ITK_SRC_3.20.1/Code/Review (with the missing file mentioned above) of the ITK source was missing in the project settings. Don&#39;t know why. So I added following line to CMakeLists.txt:<br>
<br>INCLUDE_DIRECTORIES(C:/Libs/ITK_SRC_3.20.1/Code/Review)<br><br>OK, now it works. The missing file was found by the compiler and everything is fine now. But of course this line is a little bit ugly because I need to know the absolute path to the ITK source.<br>
Does anybody know a better looking solution?<br><br><br>With kind regards,<br>Michael<br>