diff --git a/Aliases/gz-cmake4 b/Aliases/gz-cmake4 deleted file mode 120000 index 9f6438c5a..000000000 --- a/Aliases/gz-cmake4 +++ /dev/null @@ -1 +0,0 @@ -../Formula/gz-cmake3.rb \ No newline at end of file diff --git a/Formula/gz-cmake4.rb b/Formula/gz-cmake4.rb new file mode 100644 index 000000000..f19ed3079 --- /dev/null +++ b/Formula/gz-cmake4.rb @@ -0,0 +1,44 @@ +class GzCmake4 < Formula + desc "CMake helper functions for building robotic applications" + homepage "https://gazebosim.org" + url "https://github.com/gazebosim/gz-cmake.git", branch: "main" + version "3.999.999-0-20231006" + license "Apache-2.0" + + head "https://github.com/gazebosim/gz-cmake.git", branch: "gz-cmake4" + + depends_on "cmake" + depends_on "pkg-config" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=OFF" + + # Use build folder + mkdir "build" do + system "cmake", "..", *cmake_args + system "make", "install" + end + end + + test do + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR) + project(gz-test VERSION 0.1.0) + find_package(gz-cmake4 REQUIRED) + gz_configure_project() + gz_configure_build(QUIT_IF_BUILD_ERRORS) + EOS + %w[doc include src test].each do |dir| + mkdir dir do + touch "CMakeLists.txt" + end + end + mkdir "build" do + system "cmake", ".." + end + # check for Xcode frameworks in bottle + cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}" + system cmd_not_grep_xcode + end +end