[Insight-users] ITK and MSVC

jiang jiang at TI . Uni-Trier . DE
Thu, 7 Aug 2003 15:27:14 +0200


Hi,
I try to build my first Visual C++ project with ITK. Firstly, I generate one
project with MFC AppWizard(exe). Then I create the CMakeList. It is as
following. I use CMake to build the project. It passed. But when I compile
the project in VC++, there is always error.
fatal error C1083: Cannot open include file: 'itkImage.h': No such file or
directory

I don't know how to solve this problem. I compare my project with the
example "HelloWorld" provided by ITK. I find that in this project workspace
External Dependencies, there are many files, and the itkImage.h also
included inside. How can I set the External Dependencies? Or use other
method to solve my problem?

Thank you very much!


Chunyan


-----------------------------------------------
my CMakeLists.txt
-----------------------------------------------
# This project is intended to be built outside the Insight source tree
PROJECT(SeeThrough)

# Find ITK.
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)


FIND_PACKAGE(VTK)
IF (VTK_FOUND)
   INCLUDE (${VTK_USE_FILE})
ELSE(VTK_FOUND)
   MESSAGE(FATAL_ERROR
           "Cannot build InsightApplications without ITK.  Please set
VTK_DIR.")
ENDIF(VTK_FOUND)


ADD_DEFINITIONS(-D_AFXDLL)
SET(CMAKE_MFC_FLAG 6)

SET( SRCS
  ChildFrm.cpp
  ImageProcess.cpp
  MainFrm.cpp
  SeeThrough.cpp
  SeeThrough.rc
  SeeThroughDoc.cpp
  SeeThroughView.cpp
  StdAfx.cpp
)


ADD_EXECUTABLE(SeeThrough WIN32 ${SRCS} )

TARGET_LINK_LIBRARIES(SeeThrough ITKCommon)