cmake: general cleanup and improve test.

This commit is contained in:
Mike McQuaid committed 2013-01-30 21:29:20 -08:00
1 parent b2702e3ae0
commit 2de4a910d4
1 file changed
+9 -5
+9 -5
View File
@@ -1,12 +1,16 @@
require 'formula'
class NoExpatFramework < Requirement
def expat_framework
'/Library/Frameworks/expat.framework'
end
satisfy :build_env => false do
not File.exist? "/Library/Frameworks/expat.framework"
not File.exist? expat_framework
end
def message; <<-EOS.undent
Detected /Library/Frameworks/expat.framework
Detected #{expat_framework}
This will be picked up by CMake's build system and likely cause the
build to fail, trying to link to a 32-bit version of expat.
@@ -16,7 +20,6 @@ class NoExpatFramework < Requirement
end
end
class Cmake < Formula
homepage 'http://www.cmake.org/'
url 'http://www.cmake.org/files/v2.8/cmake-2.8.10.1.tar.gz'
@@ -45,7 +48,8 @@ class Cmake < Formula
system "make install"
end
def test
system "#{bin}/cmake", "-E", "echo", "testing"
test do
File.open('CMakeLists.txt', 'w') {|f| f.write('find_package(Ruby)') }
system "#{bin}/cmake", '.'
end
end