Skip to content

Commit

Permalink
ignition-common5: Rename CMake project to gz-common5 (#1937)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina authored Jun 24, 2022
1 parent 46634a9 commit b59a6b1
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions Formula/ignition-common5.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class IgnitionCommon5 < Formula
desc "Common libraries for robotics applications"
homepage "https://github.com/gazebosim/gz-common"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-common.git", branch: "main"
version "4.999.999~0~20220414"
license "Apache-2.0"
Expand All @@ -10,9 +10,9 @@ class IgnitionCommon5 < Formula
depends_on "freeimage"
depends_on "gdal"
depends_on "gts"
depends_on "ignition-cmake3"
depends_on "ignition-math7"
depends_on "ignition-utils2"
depends_on "gz-cmake3"
depends_on "gz-math7"
depends_on "gz-utils2"
depends_on macos: :high_sierra # c++17
depends_on "ossp-uuid"
depends_on "pkg-config"
Expand All @@ -29,34 +29,26 @@ def install
test do
(testpath/"test.cpp").write <<-EOS
#include <iostream>
#include <ignition/common.hh>
#include <gz/common.hh>
int main() {
igndbg << "debug" << std::endl;
ignwarn << "warn" << std::endl;
ignerr << "error" << std::endl;
// // this example code doesn't compile
// try {
// ignthrow("An example exception that is caught.");
// }
// catch(const ignition::common::exception &_e) {
// std::cerr << "Caught a runtime error " << _e.what() << std::endl;
// }
// ignassert(0 == 0);
gzdbg << "debug" << std::endl;
gzwarn << "warn" << std::endl;
gzerr << "error" << std::endl;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
find_package(ignition-common5 QUIET REQUIRED)
find_package(gz-common5 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ${IGNITION-COMMON_LIBRARIES})
target_link_libraries(test_cmake gz-common5::gz-common5)
EOS
system "pkg-config", "ignition-common5"
cflags = `pkg-config --cflags ignition-common5`.split
system "pkg-config", "gz-common5"
cflags = `pkg-config --cflags gz-common5`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lignition-common5",
"-lgz-common5",
"-lc++",
"-o", "test"
system "./test"
Expand Down

0 comments on commit b59a6b1

Please sign in to comment.