[vtkusers] Mac OSX -APPL painless, please

Marius S Giurgi rendezvous at dreamxplosion.com
Fri Dec 3 01:02:48 EST 2004


Hello, dear vtk gurus.

I was really excited of starting my journey in the VTK land.. but 
before I can start exploring I really need to know HOW can I make the 
VTK applications on Mac OSX be handled properly by the window system, 
namely to have them clickable, interactive, etc.
I read through the archives about various ways to deal with this, but 
unfortunately I'm not quite convinced I got the best idea out. Some 
suggested to create a directory for the application and put the 
Content/MacOS, *.plist file etc and the executable inside, thus letting 
the system recognize it as an app (therefore dockable, clickable, 
movable etc) (..ughh..) or another option was to add something like 
this to the CMakeLists.txt :

 > IF(VTK_USE_CARBON)
 >   FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
 >   IF(VTK_APPLE_RESOURCE)
 >     ADD_CUSTOM_COMMAND(
 >       SOURCE vtk
 >       COMMAND ${VTK_APPLE_RESOURCE}
 >       ARGS Carbon.r -o ${EXECUTABLE_OUTPUT_PATH}/vtk
 >       TARGET vtk
 >       )
 >   ENDIF(VTK_APPLE_RESOURCE)
 > ENDIF(VTK_USE_CARBON)

or,

IF(APPLE)
   FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
   IF(VTK_APPLE_RESOURCE)
     ADD_CUSTOM_COMMAND(
       SOURCE mGUI
       COMMAND ${VTK_APPLE_RESOURCE}
       ARGS -t APPL /usr/local/include/FL/mac.r 
${EXECUTABLE_OUTPUT_PATH} -o
       TARGET  mGUI
       )
   ENDIF(VTK_APPLE_RESOURCE)
ENDIF(APPLE)


the latter hinting that the FLTK (mac.r) should be used to "fix" the 
executable and make it an APPL. But what if I don't want to install 
FLTK? How can I still make the VTK apps behave properly in mac osx?

I believe this OSX issue should be seriously documented or perhaps 
resolved (if possible) during the VTK installation.

For a start I'd like to get the tests (such as ./GraphicsCxxTests) to 
run properly, so that I can go ahead and play with the mouse 
interaction, the keypress interaction etc.

I (naively) assumed that this  should have been easy and elegant: 
install VTK, run the tests.. interact with them, without having to add 
patches and do tricks to make them work. :(

any ideas what's the simplest and less painful way to have Mac OSX and 
VTK be friends?
Is the latest CVS version friendlier with OSX?

marius




More information about the vtkusers mailing list