[vtkusers] Help with VTK on Mac OS X 10.2.6

roch at rogue-research.com roch at rogue-research.com
Tue Oct 21 11:20:37 EDT 2003


Hi,

I've been holding back a response because I think my method is a hack 
and hoped someone more clever would respond. I don't know if this is 
it, but we encountered a similar problem with the Medical examples. The 
problem, as I understand it, is in the way the Mac handles events. We 
solved it by embedding the command line executable in a Package like a 
typical Mac application. The drawback is that it becomes a 
double-clickable application, rather than a command-line tool, thus you 
can't pass parameters to it. If someone has a better idea, I'd love to 
hear it. In the meantime, I will try to compile for X-11 instead of 
Carbon, and try it that way.

Here are the steps I followed:

1: Create a folder, name it Cone
2: Inside the folder, create a folder called Contents
3: Inside Contents, create a folder called MacOS, and put the 
executable inside MacOS.
3: Create a file inside Contents called info.plist, and include the 
text:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM 
"file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleExecutable</key>
	<string>Cone</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
</dict>
</plist>

4: (Optional, I am told) Rename the Cone folder Cone.app.
5: Double-click on the Cone.app (sorry, it has no cool application 
icon, just the folder icon, by my experience) and it should run.

I hope this helps. Has anyone had good experience compiling for X11? I 
had originally tried to compile VTK for X11, and the X11 versions of 
python and tcltk (using fink) but the Tcl examples did not work. 
Switching to Carbon and using TcltkAqua and MacPython worked, but we 
have this Cxx issue now. It would be nice to have 2 distinct build 
strategies, one for Carbon and the other for X11 that would work for 
all the examples.

Cheers,

Roch

On Monday, October 20, 2003, at 04:29 PM, Deepa Shroff wrote:

>
>
> Hello:
>
> Based on reply received and reading through the
> archives, i modified the CMakeLists.txt file for
> Cone.cxx program.
>
> I am attaching my CMakeLists.txt.
>
> But I still cannot interact with the window.
>
> Can somebody please help me figure this out?
>
> Thanks,
>
> Deepa.
> ========
> CMakeLists.txt
>
> PROJECT (Step1)
>
> INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)
> IF (USE_VTK_FILE)
>   INCLUDE(${USE_VTK_FILE})
> ENDIF (USE_VTK_FILE)
>
> ADD_EXECUTABLE(Cone Cone.cxx)
> TARGET_LINK_LIBRARIES(Cone vtkRendering)
>
> IF(APPLE)
>   FIND_PROGRAM(VTK_APPLE_RESOURCE Rez
> /Developer/Tools)
>   IF(VTK_APPLE_RESOURCE)
>     ADD_CUSTOM_COMMAND(
>       SOURCE Cone
>       COMMAND ${VTK_APPLE_RESOURCE}
> #      ARGS -t APPL
> /Users/deepa/Project/FINAL/fltk-1.1.3/FL/mac.r -o
> ./Cone
> /System/Library/Frameworks/Carbon.framework/Versions/A/Headers/Carbon.r
>         ARGS Carbon.r -o ./Cone
>       TARGET Cone
>       )
>   ENDIF(VTK_APPLE_RESOURCE)
> ENDIF(APPLE)
>
> -----------
>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: 
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list