2010-08-30 15:47:33 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Vrpn < Formula
|
2011-10-04 16:57:28 +00:00
|
|
|
url 'ftp://ftp.cs.unc.edu/pub/packages/GRIP/vrpn/vrpn_07_29.zip'
|
|
|
|
md5 '422f13fc9cbb62d36c96f3cc3b06cec9'
|
|
|
|
head 'git://git.cs.unc.edu/vrpn.git'
|
2010-08-30 15:47:33 +00:00
|
|
|
homepage 'http://vrpn.org'
|
|
|
|
|
2011-10-04 16:57:28 +00:00
|
|
|
depends_on 'libusb' # for HID support
|
2010-08-30 15:47:33 +00:00
|
|
|
depends_on 'cmake' => :build
|
2011-10-04 16:57:28 +00:00
|
|
|
depends_on 'doxygen' if ARGV.include? '--docs'
|
2010-08-30 15:47:33 +00:00
|
|
|
|
|
|
|
def options
|
2011-10-04 16:57:28 +00:00
|
|
|
[
|
|
|
|
['--clients', 'Build client apps and tests.'],
|
|
|
|
['--docs', 'Build doxygen-based API documentation']
|
|
|
|
]
|
2010-08-30 15:47:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2011-04-13 08:48:00 +00:00
|
|
|
args = std_cmake_parameters.split
|
2010-08-30 15:47:33 +00:00
|
|
|
|
|
|
|
if ARGV.include? '--clients'
|
|
|
|
args << "-DVRPN_BUILD_CLIENTS:BOOL=ON"
|
|
|
|
else
|
|
|
|
args << "-DVRPN_BUILD_CLIENTS:BOOL=OFF"
|
|
|
|
end
|
|
|
|
args << ".."
|
|
|
|
|
|
|
|
Dir.mkdir "build"
|
|
|
|
Dir.chdir "build" do
|
|
|
|
system "cmake", *args
|
2011-10-04 16:57:28 +00:00
|
|
|
|
|
|
|
if ARGV.include? '--docs'
|
|
|
|
system "make doc"
|
|
|
|
end
|
|
|
|
|
2010-08-30 15:47:33 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|