[Insight-users] including InsightApplications

Luis Ibanez luis . ibanez at kitware . com
Fri, 26 Sep 2003 11:05:34 -0400


Hi Thimmaiah,

I'm not sure I understand your question. It seems that
you want to use pieces of InsightApplications for building
your own app.  Is that right ?

InsightApplications is not intended to be used as a
second layer toolkit. If you plan to develop long term
applications You may want to avoid using components
from InsightApplications for building on them.

It this is just for a quick prototype, one easy way to
proceed is to create a .cmake find files. For example
for FltkImageViewer you can create a file named


              FindFltkImageViewer.cmake


with a content like


FIND_PATH(FltkImageViewer_INCLUDE_DIR fltkImageViewer.h)

FIND_LIBRARY(FltkImageViewer_LIBRARY NAMES ITKFltkImageViewer)

SET(FltkImageViewer_FOUND 1)
FOREACH(var FltkImageViewer_INCLUDE_DIR
             FltkImageViewer_LIBRARY)
   IF(NOT ${var})
     SET(FltkImageViewer_FOUND 0)
   ENDIF(NOT ${var})
ENDFOREACH(var)




Then,
in the CMakeLists.txt file of your project, you add



INCLUDE(${NeedleSegmentation_SOURCE_DIR}/FindFltkImageViewer.cmake)
IF(NOT FltkImageViewer_FOUND)
   MESSAGE(FATAL_ERROR
           "Cannot build this application without FltkImageViewer. 
Please set FltkImageViewer_DIR.")
ENDIF(NOT FltkImageViewer_FOUND)


and ....

INCLUDE_DIRECTORIES (
....
   ${FltkImageViewer_INCLUDE_DIR}
...
)


LINK_LIBRARIES (
...
   ${FltkImageViewer_LIBRARY}
...
)




This is not the most elegant way to do it, but it should be
good enough for a prototype.



   Regards,


    Luis




---------------------------
Thimmaiah, Sandhya wrote:
> Hi Luis,
> I wanted to know how to write cmake if I wanted to include
> InsightApplications.If it try to include it asks for
> InsightApplicationConfig.cmake file.
>