2011-06-16 05:25:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class OpenSceneGraph < Formula
|
|
|
|
homepage 'http://www.openscenegraph.org/projects/osg'
|
2013-08-06 17:36:12 +00:00
|
|
|
url 'http://trac.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip'
|
|
|
|
sha1 'c20891862b5876983d180fc4a3d3cfb2b4a3375c'
|
|
|
|
|
2011-06-16 05:25:05 +00:00
|
|
|
head 'http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/'
|
|
|
|
|
2012-08-30 16:28:59 +00:00
|
|
|
option 'docs', 'Build the documentation with Doxygen and Graphviz'
|
2013-10-12 11:25:30 +00:00
|
|
|
option :cxx11
|
2012-08-30 16:28:59 +00:00
|
|
|
|
2011-06-16 05:25:05 +00:00
|
|
|
depends_on 'cmake' => :build
|
2013-08-06 17:36:12 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2011-06-16 05:25:05 +00:00
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'wget'
|
2012-08-30 16:28:59 +00:00
|
|
|
depends_on 'gtkglext'
|
2011-06-16 05:25:05 +00:00
|
|
|
depends_on 'gdal' => :optional
|
|
|
|
depends_on 'jasper' => :optional
|
|
|
|
depends_on 'openexr' => :optional
|
|
|
|
depends_on 'dcmtk' => :optional
|
|
|
|
depends_on 'librsvg' => :optional
|
|
|
|
depends_on 'collada-dom' => :optional
|
2012-08-30 16:28:59 +00:00
|
|
|
depends_on 'gnuplot' => :optional
|
2013-08-06 17:39:33 +00:00
|
|
|
depends_on 'ffmpeg' => :optional
|
2012-04-01 19:30:06 +00:00
|
|
|
|
2013-08-06 17:36:12 +00:00
|
|
|
if build.include? 'docs'
|
|
|
|
depends_on 'doxygen'
|
|
|
|
depends_on 'graphviz'
|
2012-06-07 19:07:25 +00:00
|
|
|
end
|
2011-06-16 05:25:05 +00:00
|
|
|
|
|
|
|
def install
|
2013-10-12 11:25:30 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
|
|
|
|
2012-08-30 16:28:59 +00:00
|
|
|
# Turning off FFMPEG takes this change or a dozen "-DFFMPEG_" variables
|
2013-08-06 17:39:33 +00:00
|
|
|
unless build.with? 'ffmpeg'
|
2012-08-30 16:28:59 +00:00
|
|
|
inreplace 'CMakeLists.txt', 'FIND_PACKAGE(FFmpeg)', '#FIND_PACKAGE(FFmpeg)'
|
|
|
|
end
|
2011-06-16 05:25:05 +00:00
|
|
|
|
2012-08-30 16:28:59 +00:00
|
|
|
args = std_cmake_args
|
|
|
|
args << '-DBUILD_DOCUMENTATION=' + ((build.include? 'docs') ? 'ON' : 'OFF')
|
2013-08-06 17:39:33 +00:00
|
|
|
|
2012-09-05 04:04:01 +00:00
|
|
|
if MacOS.prefer_64_bit?
|
2013-08-02 03:40:42 +00:00
|
|
|
args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}"
|
2011-06-16 05:25:05 +00:00
|
|
|
args << "-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio"
|
|
|
|
args << "-DOSG_WINDOWING_SYSTEM=Cocoa"
|
|
|
|
else
|
|
|
|
args << "-DCMAKE_OSX_ARCHITECTURES=i386"
|
|
|
|
end
|
2013-08-06 17:39:33 +00:00
|
|
|
|
2011-06-16 05:25:05 +00:00
|
|
|
if Formula.factory('collada-dom').installed?
|
|
|
|
args << "-DCOLLADA_INCLUDE_DIR=#{HOMEBREW_PREFIX}/include/collada-dom"
|
|
|
|
end
|
2013-08-06 17:39:33 +00:00
|
|
|
|
2012-08-16 16:09:49 +00:00
|
|
|
args << '..'
|
2011-06-16 05:25:05 +00:00
|
|
|
|
2012-08-30 16:28:59 +00:00
|
|
|
mkdir 'build' do
|
|
|
|
system 'cmake', *args
|
|
|
|
system 'make'
|
|
|
|
system 'make', 'doc_openscenegraph' if build.include? 'docs'
|
|
|
|
system 'make install'
|
|
|
|
if build.include? 'docs'
|
|
|
|
doc.install Dir["#{prefix}/doc/OpenSceneGraphReferenceDocs/*"]
|
|
|
|
end
|
2011-06-16 05:25:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|