mxcl/homebrew — pull request #20120 by nlindberg (2013-05-28 20:51:25+00:00)
Title: Adding "--tk" flag for building vtk with tk and adding proper tk header paths: Xcode 4.6.2 and brewed python, tk 8.5

This references homebrew-science issue 191.
https://github.com/Homebrew/homebrew-science/issues/191

This adds the ability to use tk wrapper extensions, by setting -DVTK_USE_TK=ON, instead of setting it to OFF by default and not offering that option. Certain tkinter widgets with Python require using this build argument, otherwise, for example, libvtkRenderingPythonTkWidget.dylib does not get built.

The other problem is that the current version of XCode (4.6.2) for whatever reason isn't picking up the proper header files for tk, so we must explicitely set them regardless of if CLT (command line tools) is installed. Even with CLT the correct headers are not being picked up and errors will be thrown.

The new option is "--tk" (using "--tk" now turns -DVTK_USE_TK=ON, otherwise it leaves it off). I also set an absolute path for TK_INCLUDE_PATH and TK_INTERNAL_PATH since command line tools for the newest XCode (4.6.2) aren't picking up the correct headers, and there's no reason not to really.

Summary:

Moved -DVTK_USE_TK=OFF out of the main def Install arg block, and move it to the bottom where it checks for

if build.include? 'tk'

and sets the variable accordingly. Also, removed the conditional

MacOS::CLT.installed?

around setting the absolute path for -DTK_INCLUDE_PATH and -DTK_INTERNAL_PATH so that it will always find the correct sdk header files for tk.