2010-08-30 15:47:33 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Vrpn < Formula
|
2012-02-21 06:04:21 +00:00
|
|
|
homepage 'http://vrpn.org'
|
2011-10-04 16:57:28 +00:00
|
|
|
url 'ftp://ftp.cs.unc.edu/pub/packages/GRIP/vrpn/vrpn_07_29.zip'
|
|
|
|
md5 '422f13fc9cbb62d36c96f3cc3b06cec9'
|
2012-02-21 06:04:21 +00:00
|
|
|
|
2011-10-04 16:57:28 +00:00
|
|
|
head 'git://git.cs.unc.edu/vrpn.git'
|
2010-08-30 15:47:33 +00:00
|
|
|
|
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 << ".."
|
|
|
|
|
2012-02-22 04:48:36 +00:00
|
|
|
mkdir "build" do
|
2010-08-30 15:47:33 +00:00
|
|
|
system "cmake", *args
|
2012-02-22 04:48:36 +00:00
|
|
|
system "make doc" if ARGV.include? '--docs'
|
2010-08-30 15:47:33 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|