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

ignition-gui5: use rendering5 #1193

Merged
merged 4 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion Aliases/ignition-gui5

This file was deleted.

110 changes: 110 additions & 0 deletions Formula/ignition-gui5.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
class IgnitionGui5 < Formula
desc "Common libraries for robotics applications. GUI Library"
homepage "https://github.com/ignitionrobotics/ign-gui"
url "https://github.com/ignitionrobotics/ign-gui/archive/225d8b66171abe8d0a6be4988cd1bd93020200ea.tar.gz"
version "4.999.999~0~20201028~225d8b"
sha256 "5d51b169ce8b3e4553c512fba15a10419d36c28dd525db64a4b7060049332715"
license "Apache-2.0"

head "https://github.com/ignitionrobotics/ign-gui", branch: "main"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 "289c263d8125c03a16b01759d32efee514d327f9cabf07b999a5fec400664f79" => :mojave
end

depends_on "cmake" => [:build, :test]
depends_on "pkg-config" => [:build, :test]
depends_on "ignition-cmake2"
depends_on "ignition-common3"
depends_on "ignition-msgs6"
depends_on "ignition-plugin1"
depends_on "ignition-rendering5"
depends_on "ignition-transport9"
depends_on macos: :mojave # c++17
depends_on "qt"
depends_on "qwt"
depends_on "tinyxml2"

def install
ENV.m64

cmake_args = std_cmake_args
cmake_args << "-DQWT_WIN_INCLUDE_DIR=#{HOMEBREW_PREFIX}/lib/qwt.framework/Headers"
cmake_args << "-DQWT_WIN_LIBRARY_DIR=#{HOMEBREW_PREFIX}/lib/qwt.framework"
cmake_args << "-DBUILD_TESTING=Off"

mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end
end

test do
(testpath/"test.cpp").write <<-EOS
#include <iostream>

#ifndef Q_MOC_RUN
#include <ignition/gui/qt.h>
#include <ignition/gui/Application.hh>
#include <ignition/gui/MainWindow.hh>
#endif

//////////////////////////////////////////////////
int main(int _argc, char **_argv)
{
std::cout << "Hello, GUI!" << std::endl;

// Increase verboosity so we see all messages
ignition::common::Console::SetVerbosity(4);

// Create app
ignition::gui::Application app(_argc, _argv);

// Load plugins / config
if (!app.LoadPlugin("Publisher"))
{
return 1;
}

// Customize main window
auto win = app.findChild<ignition::gui::MainWindow *>()->QuickWindow();
win->setProperty("title", "Hello Window!");

// Run window
// app.exec();

std::cout << "After run" << std::endl;

return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
find_package(ignition-gui5 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-gui5::ignition-gui5)
EOS
ENV.append_path "PKG_CONFIG_PATH", Formula["qt"].opt_lib/"pkgconfig"
system "pkg-config", "ignition-gui5"
cflags = `pkg-config --cflags ignition-gui5`.split(" ")
ldflags = `pkg-config --libs ignition-gui5`.split(" ")
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
"-lc++",
"-o", "test"
ENV["IGN_PARTITION"] = rand((1 << 32) - 1).to_s
system "./test"
# test building with cmake
ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt"].opt_prefix
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