Homebrew/homebrew-science — pull request #193 by nlindberg (2013-05-29 15:00:32+00:00)
Title: Adding "--with-tk" flag for building vtk with tk, and setting absolute path to tk headers (tested on Xcode 4.6.2, Mac OSX 10.8.3, tk8.5)

Homebrew/homebrew-science#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) doesn't always play nice with cmake, and 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 "with-tk" (using "--with-tk" now turns -DVTK_USE_TK=ON, otherwise it leaves it off). Absolute paths for TK_INCLUDE_PATH and TK_INTERNAL_PATH are now also set for the aforementioned reasons, 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? 'with-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.