-
Notifications
You must be signed in to change notification settings - Fork 84
Rotary collection: gz-cmake, gz-utils #3287
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0862afa
Scaffold collection prototype
scpeters 2273de2
Add matching conflicts statements
scpeters 3199fd1
remove head
scpeters 67bdc22
Rename to gz-rotary-*
scpeters 8fc125b
Use formula versions 0.1.0
scpeters 34e9d1d
Use head instead of stable url, version
scpeters 95e1fd4
Merge branch 'master' into scpeters/scaffold_prototype
scpeters 131d26b
print caveats after install
scpeters 8dc5349
gz-rotary-utils: add missing fmt dep
scpeters 98930b7
Merge branch 'master' into scpeters/scaffold_prototype
scpeters File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../Formula/gz-rotary-cmake.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../Formula/gz-rotary-utils.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| class GzRotaryCmake < Formula | ||
| desc "CMake helper functions for building robotic applications" | ||
| homepage "https://gazebosim.org" | ||
| license "Apache-2.0" | ||
|
|
||
| head "https://github.com/gazebosim/gz-cmake.git", branch: "main" | ||
|
|
||
| depends_on "cmake" | ||
| depends_on "pkgconf" | ||
|
|
||
| conflicts_with "gz-jetty-cmake", because: "both install gz-cmake" | ||
|
|
||
| def install | ||
| cmake_args = std_cmake_args | ||
| cmake_args << "-DBUILD_TESTING=OFF" | ||
|
|
||
| # Use a build folder | ||
| mkdir "build" do | ||
| system "cmake", "..", *cmake_args | ||
| system "make", "install" | ||
| end | ||
| end | ||
|
|
||
| def caveats | ||
| <<~EOS | ||
| This is an unstable, development version of Gazebo built from source. | ||
| EOS | ||
| end | ||
|
|
||
| test do | ||
| (testpath/"CMakeLists.txt").write <<-EOS | ||
| cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) | ||
| project(gz-test VERSION 0.1.0) | ||
| find_package(gz-cmake 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| class GzRotaryUtils < Formula | ||
| desc "General purpose classes and functions designed for robotic applications" | ||
| homepage "https://github.com/gazebosim/gz-utils" | ||
| license "Apache-2.0" | ||
|
|
||
| head "https://github.com/gazebosim/gz-utils.git", branch: "main" | ||
|
|
||
| depends_on "cmake" => [:build, :test] | ||
| depends_on "pkgconf" => [:build, :test] | ||
| depends_on "cli11" | ||
| depends_on "fmt" | ||
| depends_on "gz-rotary-cmake" | ||
| depends_on "spdlog" | ||
|
|
||
| conflicts_with "gz-jetty-utils", because: "both install gz-utils" | ||
|
|
||
| def install | ||
| cmake_args = std_cmake_args | ||
| cmake_args << "-DBUILD_TESTING=OFF" | ||
| cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}" | ||
|
|
||
| # Use a build folder | ||
| mkdir "build" do | ||
| system "cmake", "..", *cmake_args | ||
| system "make", "install" | ||
| end | ||
| end | ||
|
|
||
| def caveats | ||
| <<~EOS | ||
| This is an unstable, development version of Gazebo built from source. | ||
| EOS | ||
| end | ||
|
|
||
| test do | ||
| (testpath/"test.cpp").write <<-EOS | ||
| #include <gz/utils/ImplPtr.hh> | ||
| class SomeClassPrivate | ||
| { | ||
| }; | ||
| class SomeClass | ||
| { | ||
| private: gz::utils::ImplPtr<SomeClassPrivate> dataPtr = | ||
| gz::utils::MakeImpl<SomeClassPrivate>(); | ||
| }; | ||
| int main() { | ||
| SomeClass object; | ||
| return 0; | ||
| } | ||
| EOS | ||
| (testpath/"CMakeLists.txt").write <<-EOS | ||
| cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR) | ||
| find_package(gz-utils QUIET REQUIRED) | ||
| add_executable(test_cmake test.cpp) | ||
| target_link_libraries(test_cmake gz-utils::gz-utils) | ||
| EOS | ||
| system "pkg-config", "gz-utils" | ||
| cflags = `pkg-config --cflags gz-utils`.split | ||
| ldflags = `pkg-config --libs gz-utils`.split | ||
| system ENV.cxx, "test.cpp", | ||
| *cflags, | ||
| *ldflags, | ||
| "-o", "test" | ||
| system "./test" | ||
| # test building with cmake | ||
| mkdir "build" do | ||
| system "cmake", ".." | ||
| system "make" | ||
| system "./test_cmake" | ||
| end | ||
| # check for Xcode frameworks in bottle | ||
| cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}" | ||
| system cmd_not_grep_xcode | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.