[Insight-users] Simple CMakeList.txt

Mathieu Lamard Mathieu.Lamard@enst-bretagne.fr
Wed, 06 Nov 2002 14:32:18 +0100


Hi,

With the new version of ITK, I have updated my system, and like usual my 
program din't compile any more. In fact it is a problem of 
CMakeList.txt. I'am using ITK+VTK+FLTK. Since now my CMakeList.txt works 
under windows and linux but I am not statified with it. For me it wasn't 
well writen.
I have seen a new file : ITKConfig.cmake It seem good for me.

My projet isn't in the ITK tree
Here is The CMakeList.txt that son't work.

PROJECT(Echolyse2)

INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (  USE_ITK_FILE  )
          INCLUDE(  ${USE_ITK_FILE}  )	
ENDIF(   USE_ITK_FILE   )

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
IF (   USE_VTK_FILE   )
          INCLUDE(  ${USE_VTK_FILE}  )
ENDIF(   USE_VTK_FILE   )

INCLUDE (${CMAKE_ROOT}/Modules/FindFLTK.cmake)
IF (   USE_FLTK_FILE   )
          INCLUDE(  ${USE_FLTK_FILE}  )
ENDIF(   USE_FLTK_FILE   )

SET(ITK_DIR "/home/lamard/Ecospec/dev/Insight")

#Without this line the ${ITK_DIR} is not found

INCLUDE(${ITK_DIR}/ITKConfig.cmake)

INCLUDE_DIRECTORIES(${ITK_INCLUDE_DIRS})
LINK_DIRECTORIES(${ITK_LIBRARY_DIRS})
ADD_DEFINITIONS(${ITK_DEFINITIONS})


SOURCE_FILES(Echolyse_SRCS
Vasculaire
Algorithm
Contour
GateWay
Echolyse2
Echolyse2-Vasculaire
main
)

SOURCE_FILES(Echolyse_GUI_SRCS
Echolyse2GUI.fl
)
TARGET_LINK_LIBRARIES((Echolyse2-exe ${ITK_LIBRARIES})

ADD_EXECUTABLE(Echolyse2-exe Echolyse_SRCS)

FLTK_WRAP_UI(Echolyse2-exe Echolyse_GUI_SRCS)


Can some one help me ? I just want an easy use CMakeList for my projet

Mathieu