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 28, 2024
1 parent 0a6963f commit 7d5b6e9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 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,7 +38,6 @@ 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
Expand Down Expand Up @@ -75,22 +74,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 7d5b6e9

Please sign in to comment.