[Insight-users] CMAKE command to link Fltk (fluid) in a code

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 22 14:00:54 EDT 2004


Hi Alexandre,


CMake offers you a much better way of managing the .fl
files from fluid. In fact, CMake is fully FLTK-aware.


Please look at the Tutorial sessions

   http://www.itk.org/HTML/Tutorials.htm

in particular to

    "ITK and Graphical User Interface"
http://www.itk.org/CourseWare/Training/GettingStarted-IV.pdf

where you will find instructions on how to use
ITK along with FLTK or with Qt, and how to setup
CMakeLists.txt files using ITK + FLTK.


You will find multiple examples of ITK+FLTK
configurations in the InsightApplications checkout.


Here is for example, an extract from the CMakeLists.txt
file of the GaussianFilter demo application available at
InsightApplications:


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

INCLUDE_DIRECTORIES(
   ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
   ${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
   ${InsightApplications_SOURCE_DIR}/GaussianFilter
   ${InsightApplications_BINARY_DIR}/GaussianFilter
)

SET(GaussianFilter_SRCS
   liFilterConsole.cxx
   liFilterConsoleBase.cxx
   GaussianFilter.cxx
   )

ADD_GUI_EXECUTABLE(GaussianFilter   "${GaussianFilter_SRCS}")

FLTK_WRAP_UI(GaussianFilter liFilterConsoleGUI.fl)

ITK_DISABLE_FLTK_GENERATED_WARNINGS(liFilterConsoleGUI.fl)

TARGET_LINK_LIBRARIES(GaussianFilter
                        ITKFltkImageViewer ITKIO ITKBasicFilters)

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

The CMake command:

              FLTK_WRAP_UI()

is the one that knows what to do with the .fl fluid files.
It will take care of generating the .cxx and .h files for
your and it will add them to the list of files to be compiled.



Please let us know if you have further questions.


    Thanks


      Luis



---------------------------
Alexandre gouaillard wrote:

> dear all,
> 
> that might not be the best place to post my question, but i don't know 
> any better , thus ,
> 
> thanks to mathieu and luis advices, i switched to cmake and bypassed 
> most of my compiling problems.
> Still, the FindFLTK.cmake file provided by cmake 2.0 would require some 
> upgrade for windows.
> Anyway, my curent probelm is how to call an executable from cmake to 
> make some pre-processing.
> just like swig for python, i need to generate .cxx and .h from FLUID by 
> invoking the following command
> PATH_TO_FLUID_EXE -c MY_FLUID_FILE.fl
> 
> I tried the following command :
> EXEC_PROGRAM(${FLTK_FLUID_EXECUTABLE} ./ ARGS -c my_fluid_file.fl)
> but it didn't have any visible effect.
> 
> any idea about what i m doing wrong here ?
> 
> alex.
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list