bullet: use options dsl

This commit is contained in:
Adam Vandenberg 2012-08-08 22:30:34 -07:00
parent 5eb4cca548
commit 28959bf01d

View file

@ -9,37 +9,33 @@ class Bullet < Formula
depends_on 'cmake' => :build
def options
[
['--framework' , "Build Frameworks"],
['--universal' , "Build in universal mode"],
['--shared' , "Build shared libraries"],
['--build-demo' , "Build demo applications"],
['--build-extra', "Build extra library"]
]
end
option :universal
option 'framework', 'Build Frameworks'
option 'shared', 'Build shared libraries'
option 'build-demo', 'Build demo applications'
opiton 'build-extra', 'Build extra library'
def install
args = []
if ARGV.include? "--framework"
if build.include? "--framework"
args << "-DBUILD_SHARED_LIBS=ON" << "-DFRAMEWORK=ON"
args << "-DCMAKE_INSTALL_PREFIX=#{prefix}/Frameworks"
args << "-DCMAKE_INSTALL_NAME_DIR=#{prefix}/Frameworks"
else
args << "-DBUILD_SHARED_LIBS=ON" if ARGV.include? "--shared"
args << "-DBUILD_SHARED_LIBS=ON" if build.include? "--shared"
args << "-DCMAKE_INSTALL_PREFIX=#{prefix}"
end
args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if ARGV.build_universal?
args << "-DBUILD_DEMOS=OFF" if not ARGV.include? "--build-demo"
args << "-DBUILD_EXTRAS=OFF" if not ARGV.include? "--build-extra"
args << "-DCMAKE_OSX_ARCHITECTURES='i386;x86_64'" if build.universal?
args << "-DBUILD_DEMOS=OFF" if not build.include? "--build-demo"
args << "-DBUILD_EXTRAS=OFF" if not build.include? "--build-extra"
system "cmake", *args
system "make"
system "make install"
prefix.install 'Demos' if ARGV.include? "--build-demo"
prefix.install 'Extras' if ARGV.include? "--build-extra"
prefix.install 'Demos' if build.include? "--build-demo"
prefix.install 'Extras' if build.include? "--build-extra"
end
end