[Insight-developers] CMakeLists files and FLTK / VTK

Luis Ibanez luis.ibanez@kitware.com
Fri, 29 Mar 2002 18:31:16 -0500


Hi,

A good fraction of the questions in the users-list have
been related to seeting up the configuration for running
the Examples, in particular to the configuration of FLTK
and VTK.

Taken this into account, a set of changes have been made
in the CMakeLists.txt  files with the aim of simplifying the
initial configuration.


Here is the account of the changes:


1) In Insight/Utilities
    a file ITKFindFLTK.cmake was added. It includes the
    FindFLKT.cmake module and set up a flag : HAS_FLTK

2) All the CMakeLists.txt files of directories relying on FLTK
     have been modified in order to use this flag as opposed to
     include "FindFLTK.cmake" directly.

3) An Option "USE_FLTK" has been added to the top
     CMakeLists.txt file.   Only when the user select this option
     CMake will include FindFLTK.cmake and ask for the paths
     to FLTK libraries, headers and fluid.  The FLTK_WRAP_UI
     command was made internal since it always has to be on when
     FLTK is being used.

    New code requiring FLTK has to use :

   IF( HAS_FLTK)
      SUBDIR(myDirectoryRequiresFltk)
   ENDIF(HAS_FLTK)

     and will only be built if the user selected USE_FLTK and
     all the paths were found. (otherwise the code is just ignored,
      no error messages are produced).

4) In Insight/Utilities
    the file ITKFindVTK.cmake was modified so that CMake
   verifies if VTK was built using the VTK_USE_ANSI_STDLIB
    option (which is required in order to be compatible with ITK).

    If the option was not used an error message is displayed.

5)  A flag "HAS_VTK" was added. It substitutes the use of
      USE_VTK_FILE as a flag. (USE_VTK_FILE is still holding
       the path of the corresponding .cmake file).

       The internal "HAS_VTK" flag is only set ON if the user
      has selected "USE_VTK" and all the necessary paths have
      been found.

       New code relaying on VTK being available should use

      IF( HAS_VTK )
            SUBDIR( myDirectoryRequiresVTK)
      ENDIF(HAS_VTK)       

      in its corresponding CMakeLists.txt file.


------------------------------

It will probably be neecessary to rerun CMake with
a human user to set the configurations.  So the CMakeLists
files with potential conflicts will only be checked in on
monday morning.   The changes for support has already
been checked in.

An experimental run on Terminus is being done with
these modifications.



Hopefully these changes will simplify the installation of
the toolkit.




    Luis