[Insight-users] ITK&VTK Project in Visual C++

Luis Ibanez luis . ibanez at kitware . com
Mon, 29 Sep 2003 16:08:32 -0400


This is a multi-part message in MIME format.
--------------080504070206070905050102
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi Robert,

Can you please post your current CMakeLists.txt file ?

Note that once you generate a Visual Studio project
from CMake, you should *NOT* modify this project from
the VC++ IDE. All changes must be made in the original
CMakeLists.txt file and from it the a new project file
must be generated.

Please find attached the CMakeLists.txt file of a typical
application that is using ITK, VTK and FTLK.


Regards,


    Luis


-------------------------------
Robert-Paul Buitendijk wrote:
> Hello everone
> 
> How do I correctly write a CMakeList.txt file including the ITK&VTK
> libraries maintaining
> my allready written C++ file.
> 
> The Current CMakeLIST.txt file does add the requested libraries, but i loose
> all my info for my existing project.
> 
> tnx in advance
> RP
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
> 



--------------080504070206070905050102
Content-Type: text/plain;
 name="CMakeLists.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CMakeLists.txt"


PROJECT( ApplicationModel )



#
#  FIND ITK
#
FIND_PACKAGE(ITK)
IF (USE_ITK_FILE)
  INCLUDE (${USE_ITK_FILE})
ELSE (USE_ITK_FILE)
  MESSAGE( FATAL_ERROR "This application requires ITK. One of these components is missing. Please verify configuration")
ENDIF (USE_ITK_FILE)


#
# FIND VTK
#
FIND_PACKAGE(VTK)
IF (USE_VTK_FILE)
  INCLUDE (${USE_VTK_FILE})
ELSE (USE_VTK_FILE)
  MESSAGE( FATAL_ERROR "This application requires VTK. One of these components is missing. Please verify configuration")
ENDIF (USE_VTK_FILE)



#
# FIND FLTK
#
FIND_PACKAGE(FLTK)
IF (FLTK_FOUND)
  INCLUDE_DIRECTORIES (${FLTK_INCLUDE_DIR})
ELSE (FLTK_FOUND)
  MESSAGE( FATAL_ERROR "This application requires FLTK. One of these components is missing. Please verify configuration")
ENDIF (FLTK_FOUND)


INCLUDE_DIRECTORIES(
  ${ApplicationModel_SOURCE_DIR}
  )

#
#  Define the list of source files
#
SET(APPLICATION_SOURCES
  DicomImageReaderBase.cxx
  ImageSliceViewer.cxx
  ApplicationBase.cxx
  Application.cxx
  vtkFlRenderWindowInteractor.cxx
  InteractorObserver.cxx
  )


ADD_LIBRARY(ApplicationModel ${APPLICATION_SOURCES})
FLTK_WRAP_UI(ApplicationModel ApplicationGUI.fl DicomImageReaderGUI.fl)

ADD_EXECUTABLE( ApplicationPrototype main.cxx )


TARGET_LINK_LIBRARIES( ApplicationModel
    ITKIO ITKBasicFilters ITKNumerics ITKCommon 
    vtkRendering vtkGraphics vtkHybrid vtkImaging 
    vtkIO vtkFiltering vtkCommon 
    ${FLTK_LIBRARIES}
    )


TARGET_LINK_LIBRARIES( ApplicationPrototype
    ApplicationModel
    )


--------------080504070206070905050102--