Skip to content

Commit

Permalink
cgal 6.0
Browse files Browse the repository at this point in the history
- remove FindOpenMesh.cmake
- test with Qt6

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
  • Loading branch information
BrewTestBot and carlocab committed Sep 29, 2024
1 parent 9e06b34 commit e264b5c
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Formula/c/cgal.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Cgal < Formula
desc "Computational Geometry Algorithms Library"
homepage "https://www.cgal.org/"
url "/~https://github.com/CGAL/cgal/releases/download/v5.6.1/CGAL-5.6.1.tar.xz"
sha256 "cdb15e7ee31e0663589d3107a79988a37b7b1719df3d24f2058545d1bcdd5837"
url "/~https://github.com/CGAL/cgal/releases/download/v6.0/CGAL-6.0.tar.xz"
sha256 "6b0c9b47c7735a2462ff34a6c3c749d1ff4addc1454924b76263dc60ab119268"
license "GPL-3.0-or-later"

bottle do
Expand All @@ -11,7 +11,7 @@ class Cgal < Formula
end

depends_on "cmake" => [:build, :test]
depends_on "qt@5" => :test
depends_on "qt" => :test
depends_on "boost"
depends_on "eigen"
depends_on "gmp"
Expand All @@ -38,10 +38,12 @@ def install
FindLASLIB.cmake
FindMKL.cmake
FindOSQP.cmake
FindOpenMesh.cmake
FindSuiteSparse.cmake
]
inreplace inreplace_files.map { |file| lib/"cmake/CGAL"/file }, "/usr/local", HOMEBREW_PREFIX

# These cause different bottles to be built between macOS and Linux for some reason.
%w[README.md readme.md].each do { |file| (buildpath/file).unlink if (buildpath/file).exist? }
end

test do
Expand All @@ -62,7 +64,6 @@ def install
typename CGAL::Coercion_traits<A,B>::Type
binary_func(const A& a , const B& b){
typedef CGAL::Coercion_traits<A,B> CT;
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
typename CT::Cast cast;
return cast(a)*cast(b);
}
Expand All @@ -75,22 +76,22 @@ def install
std::istream_iterator<Point> end;
Triangulation t;
t.insert(begin, end);
if(argc == 3) // do not test Qt5 at runtime
if(argc == 3) // do not test Qt6 at runtime
CGAL::draw(t);
return EXIT_SUCCESS;
}
EOS
(testpath/"CMakeLists.txt").write <<~EOS
cmake_minimum_required(VERSION 3.1...3.15)
find_package(CGAL COMPONENTS Qt5)
find_package(CGAL COMPONENTS Qt6)
add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
include_directories(surprise BEFORE SYSTEM #{Formula["qt@5"].opt_include})
include_directories(surprise BEFORE SYSTEM #{Formula["qt"].opt_include})
add_executable(surprise surprise.cpp)
target_include_directories(surprise BEFORE PUBLIC #{Formula["qt@5"].opt_include})
target_link_libraries(surprise PUBLIC CGAL::CGAL_Qt5)
target_include_directories(surprise BEFORE PUBLIC #{Formula["qt"].opt_include})
target_link_libraries(surprise PUBLIC CGAL::CGAL_Qt6)
EOS
system "cmake", "-L", "-DQt5_DIR=#{Formula["qt@5"].opt_lib}/cmake/Qt5",
"-DCMAKE_PREFIX_PATH=#{Formula["qt@5"].opt_lib}",
system "cmake", "-L", "-DQt6_DIR=#{Formula["qt"].opt_lib}/cmake/Qt6",
"-DCMAKE_PREFIX_PATH=#{Formula["qt"].opt_lib}",
"-DCMAKE_BUILD_RPATH=#{HOMEBREW_PREFIX}/lib", "-DCMAKE_PREFIX_PATH=#{prefix}", "."
system "cmake", "--build", ".", "-v"
assert_equal "15\n15", shell_output("./surprise").chomp
Expand Down

0 comments on commit e264b5c

Please sign in to comment.