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

Luis Ibanez luis.ibanez at kitware.com
Fri Jul 23 14:48:02 EDT 2004


Hi Alexandre,

Thanks for pointing this out.

You are right, the command

    ADD_GUI_EXECUTABLE

is actually a macro defined in the top
CMakeLists.txt file of InsightApplications.

It contains extra code for making an executable
work in a Mac (e.g. manage resources...).

If you are not using a Mac, you can simply set

     ADD_EXECUTABLE


The

     TK_DISABLE_FLTK_GENERATED_WARNINGS

is only intended to suppress a lot of signed/unsigned
warnings generated from FLTK headers. That can also
be removed.


----

About the single file issue...

If you really want to do this manually, what
you want to use is the ADD_CUSTOM_COMMAND().

Define a ADD_CUSTOM_COMMAND() for invoking FLUID
and generating the .cxx file. Then you set the
.cxx file as the only source file in you
ADD_EXECUTABLE command.



For details on this command just type


     cmake --help ADD_CUSTOM_COMMAND




CMake has a built-in help for all the commands.



   Regards,


      Luis



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

> thanks luis
> 
> Note that from the code you copy/pasted , there is some command not 
> understood by my CMAKE 2.0 :
> ADD_GUI_EXECUTABLE, ITK_DISABLE_FLTK_GENERATED_WARNINGS
> I couldn't check if these were valid command of CMAKE 2.0 as only the 
> CMAKE 1.8x commands are listed on the CMAKE website (as far as i searched).
> 
> well, changing the ADD_GUI_.... to ADD_... worked fine and i just 
> commented out the second command.
> 
> Then, in my project , there is only the .cxx file made by FLUID and 
> nothing else.
> Thus, If i create the project like you recommend one to do it will look 
> like that:
> 
> ADD_EXECUTABLE(Cylinder CylinderGUI.cxx)
> FLTK_WRAP_UI(Cylinder CylinderGUI.fl)
> TARGET_LINK_LIBRARIES(Cylinder itkCommon fltkdll .........)
> 
> In that case, the file CylinderGUI.cxx appears twice in the project and 
> the project is not valid.
> 
> I know that, acording to the tao of programming, I should have my 
> process and my GUI appart from each other,
> and that my actual project doesn't really make sense, but let's say that 
> for political reasons (this is not my code)
> I have to do this way ... for now.
> 
> Is there a cannonical way to do what I'm trying to do ?
> I m thinking about calling the Fluid executable to build the .cxx file 
> prior to the executable declaration ...
> Of course i could make a blank foo.cxx file and add it when declaring 
> the project , but that solution would be a little bit too "quick and 
> nasty".
> 
> 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