Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgal 6.0 #192120

Merged
merged 2 commits into from
Sep 29, 2024
Merged

cgal 6.0 #192120

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { |file| (buildpath/file).unlink if (buildpath/file).exist? }
Comment on lines +43 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry for that. Our test process missed that a few files were added to CGAL-6.0 root directory, and in particular a file readme.md. See CGAL/cgal@0444375.

It will be fixed in CGAL-6.0.1, that I plan to publish soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem; thanks for the update!

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
Loading