[Insight-developers] CMake and external toolkits

Bill Hoffman bill.hoffman@kitware.com
Fri, 06 Apr 2001 11:03:45 -0400


You want to use these cmake commands:
cmFindIncludeCommand
cmFindLibraryCommand

In your cmakelists file add these:

FIND_INCLUDE( FLTK_INCLUDE path1 path2 )
FIND_LIBRARY( FLTK_LIBRARY try1 try2 )

Then use FLTK_INCLUDE and FLTK_LIBRARY as a variables in the cmakelists file.
They will be put into the cache file automatically for you.

-Bill

At 10:54 AM 4/6/2001 -0400, Luis Ibanez wrote:

>Hi,
>
>I'm having trouble with settin variables in a CMakeList.txt file.
>Here is the case:
>
>
>A small image viewer was added to the Unsupported directory
>under the name FltkImageViewer. This viewer is a class intended
>to be used in itk programs, in the following way:
>
>  typedef fltk::ImageViewer< ImageType > ViewerType;
>  ViewerType::Pointer   viewer = ViewerType::New();
>  viewer->SetImage( theImageIwantToView );
>  viewer->Show();
>
>It requires an external toolkit "FLTK" for GUI.
>This is open source and can be downloaded from http://www.fltk.org.
>It runs on Windows95/NT, Linux, SunOS, IRIX and other systems.
>
>The CMakeList file indicates where the user has installed FLTK,
>for that, the variables FTLK_INCLUDE_DIR and FLTK_LIBRARY_DIR
>have been added.
>
>However I'm having trouble getting them into the VC++ project
>generated after running CMakeSetup.
>
>What I'm doing is to run CMakeSetup, and when the notepad
>pops up with the CMakeCache.txt file, I add :
>
>FLTK_INCLUDE_DIR:FILEPATH=H:/usr/local/fltk
>FLTK_LIBRARY_DIR:FILEPATH=H:/usr/local/fltk/lib
>
>save the file and close it.
>
>After that, the VC++ project for FltkImageViewer contains
>in |Project|->|Settings|->|C/C++|->|Preprocesor| include
>directories the explicit string: ${FLTK_INCLUDE_DIR}
>instead of the expanded content of the string.
>
>What the right way to define the variables in order
>to get the expanded string ?
>
>
>
>Luis
>
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers@public.kitware.com
>http://public.kitware.com/mailman/listinfo/insight-developers